시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 11 | 1 | 1 | 100.000% |
A tank car that transports gasoline via rail road has a shape of cylinder with two spherical caps at the sides. The cylinder has a diameter \(d\) and a length \(l\). The spherical caps have a radius \(r\) (\(2r\) ≥ \(d\)). There was the rail road accident and the tank car had derailed. It now lies on the ground and some of the stored gasoline had flown out. The damage assessment must be performed. The location of the tank on the ground was established by measuring its tilt as the height difference \(t\) from the bottom points of the cylinder on its left and right sides (0 ≤ \(t\) ≤ \(l\)). The level of gasoline in the tank was established by measuring the height difference \(h\) from the bottom point of the cylinder and the top level of gasoline. For the purpose of this problem, the top level of gasoline always intersects the cylinder part of the tank (0 ≤ \(h\) ≤ \(t + d \sqrt{1 - (t/l)^2}).
Your task is to figure out how much gasoline was left in the tank.
The input file consists of a single line with five integer numbers — \(d\), \(l\), \(r\), \(t\) and \(h\), which represent the diameter and the length of the tank’s cylinder part, the radius of its spherical caps, tilt and gasoline level measurements. They are all expressed in millimeters (1 millimeter = 10−3 meters), they satisfy all constraints expressed in the problem statement and \(d\), \(l\) ≥ 100, \(d\), \(l\), \(r\) ≤ 10 000.
Write a single real number to the output file — the volume of gasoline in the tank in liters (1 liter = 10−3 cubic meters). The absolute error of the answer must not exceed 0.1 liters.
3000 6000 1600 0 3000
50974.56
3000 6000 1600 3441 4228
40728.90
ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > NEERC 2014 D번