NC206964. TanksandPipes
描述
输入描述
The first line of input contains a single integer P, (1 P 100), which is the number of data sets that follow. Each data set should be processed identically and independently.
Each data set consists of one line of input. The line contains the data set number, K, followed by four floating point values: the radius, RT, of the tank, the radius, RP, of the pipe, the perpendicular offset from the axis of the cylinder to the axis of the pipe and the slope of the pipe axis with respect to the plane perpendicular to the cylinder axis.
For a given point on the pipe axis, dperp is the perpendicular distance to the plane perpendicular to the cylinder axis and dplane is the distance along the plane. The slope of the pipe axis is (dperp/dplane).
输出描述
For each data set there is 1 line of output.
The output line consists of the data set number, K, followed by the length of the intersection of the pipe with the cylindrical tank wall as a floating point value to 3 decimal places.
示例1
输入:
4 1 4 1 0 0 2 4 1 0 1 3 4 1 2.5 0 4 4 1 2.5 1
输出:
1 6.308 2 7.669 3 7.429 4 9.338