CF 二分

来源:互联网 发布:linux自动挂载 编辑:程序博客网 时间:2024/05/22 13:34

http://codeforces.com/gym/100796/problem/I

二分

 

I. Shell Game

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Bob has discovered a new quality in himself — he likes to trick people a lot! In particular, Bob wants to try his tricking skills in the shell game.

The shell game involves three identical cups and a single ball. In the beginning the host (that's Bob!) puts the cups upside down and places the ball inside one of the cups. Then he shuffles the cups and the player has to guess where the ball is. The host then lifts that cup, revealing whether the ball was inside or not. The player wins if he makes a correct guess, otherwise the host wins.

The form of each cup is a sliced cone. Formally, the base of the cup is a circle with radius r, and the opening of the cup is a circle with radius R. The height of the cup is equal to h. A ball for the shell game is simply a sphere.

What the player is not going to know is that Bob smeared the inner surface of each cup with glue, resulting in the cup holding the ball when Bob lifts it up — so the player will never win! However, the ball will stick only if it touches the inner surface of a cup. For this reason Bob wants to get the largest possible ball that fits inside the cup when the cup is placed upside down on the table.

Bob has already found three identical cups in his grandmother's locker — now he only has to buy a ball of the required size so that he may start playing the shell game. Help Bob and calculate the largest size of such a ball!

Input

The first line contains three space-separated integers rR and h, the radii of the base and the opening, and the height of the cup (1 ≤ r < R ≤ 1041 ≤ h ≤ 104).

Output

Output a single number — the radius of the largest ball that can fit in the cup. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

input

3 4 8

output

3.531128874149


点到直线的距离公式用一下就可以了,然后要注意有两个条件限制,一个是点到直线的距离显示,还有一个就是mid不能超过h1/2


0 0