logo AlgoBeat OnlineJudge
登录 注册

#206146. [NEERC 2014] Damage Assessment

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 and a length The spherical caps have a radius 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 from the bottom points of the cylinder on its left and right sides The level of gasoline in the tank was established by measuring the height difference 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

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 -- and 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 ( millimeter meters), they satisfy all constraints expressed in the problem statement and .

输出格式

Write a single real number to the output file -- the volume of gasoline in the tank in liters ( liter cubic meters). The absolute error of the answer must not exceed . liters.

样例

样例输入 1

3000 6000 1600 0 3000

样例输出 1

50974.56

样例输入 2

3000 6000 1600 3441 4228

样例输出 2

40728.90

数据范围与提示

Time limit: 1 s, Memory limit: 256 MB.