Damage Assessment
题号:NC54474
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

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 ().
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 ≤ 10000.

输出描述:

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.

示例1

输入

复制
3000 6000 1600 0 3000

输出

复制
50974.56
示例2

输入

复制
3000 6000 1600 3441 4228

输出

复制
40728.90

备注:

Author: Roman Elizarov