High School Programming League 2008/2009

Pythagorean tent

Problem code: HS09PYTH

The PythTent Corporation assembles tents of an unusual Pythagorean shape. Each tent is a right prism, where the front and the rear wall of the tent is a Pythagorean triangle, i.e. a right triangle with sides of integer length (measured in centimeters). The right angle is the one on the roof.

Unfortunately, their database crashed lately and there are many gaps in the data. For many tent projects all that remains known is the area of the fabric needed to make the floor and roof (together), and the area of the front and rear wall (together). Also the length of the tent (i.e. the distance from the front to the rear wall) is known. However, the Head of Department responsible for tent frame production needs to know the height of each tent! Write a program to help him.

 

Input

There are K (1≤K≤30 000) lines of input. Each line contains three integers F, S, h (1≤F, S≤2 000 000 000; 10≤h≤500), where F – the area of the front (or rear) triangle in square centimeters, S – the area of the floor and roof in square centimeters, h – length of the tent. Line K+1 contains three zeros, which shouldn't be processed.

 

Output

Write a number for each line of input, which is the height of the tent for the given testcase, accurate to 0.01.

Example

Input:

6 120 10

24 2400 100
0 0 0

Output:

2.40
4.80

Scoring

For solving this problem you will score 10 points.


Added by:Adam Dzedzej
Date:2010-03-02
Time limit:1s
Source limit:50000B
Languages:SED C99 strict C++ 4.0.0-8 C++ 4.3.2 TCL SCALA NICE NEM PHP SCM guile LISP sbcl LISP clisp ERL TECS TEXT DOC PDF PS PERL 6 JS
Resource:High School Programming League (thanks to Talent Association)
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.