eolymp
bolt
Try our new interface for solving problems
Problems

Ryaba Hen

Ryaba Hen

Ryaba Hen has laid an egg; not a simple egg, but a titanium one. The old man hit and hit the egg, but couldn't crack it. The old woman hit and hit the egg, but couldn't crack it. The mouse hit and hit the egg, but couldn't crack it either. Then the mouse got angry and rolled the egg upon the roof, in order to drop it down and crack. The sideview of the roof is shown at the picture. \includegraphics{https://static.e-olymp.com/content/9c/9c230d156801c881456508cb6811429804ad9412.jpg} The left lower vertex of the isosceles triangle on the picture has coordinates (\textbf{0}, \textbf{0}). The mouse climbed along the slope up to the point (\textbf{l}, \textbf{H}), lifted the egg to the height h from this point and dropped the egg. The egg hit the roof, bounced, flew a certain distance, bounced again, and so on, until it fell down to the ground. The egg never cracked, but it has got a dent from each collision with the roof. How many dents will the mouse find when it gets down from the roof? Though the mouse didn't study at a technical university, it knows that the gravitational acceleration is \textbf{10}, that collisions of the egg and the roof are absolutely elastic (and the incidence angle equals the reflection angle) even if the egg hits the lowest point of the roof, and that the size of the egg may be neglected in calculations. Also, the point (\textbf{l}, \textbf{H}) is not the uppermost point of the roof. \InputFile The first line contains the number of tests \textbf{N} ≤ \textbf{1000}. Each of the next \textbf{N} lines contains three integers: \textbf{H}, \textbf{l}, \textbf{h}. \textbf{1} ≤ \textbf{H}, \textbf{l} ≤ \textbf{10^100}. \textbf{1} ≤ \textbf{h} ≤ \textbf{10}. \OutputFile For each test, output in a separate line the number of dents on the egg.
Time limit 1 second
Memory limit 64 MiB
Author Alexander Ipatov
Source Ural SU and Orel STU Contest. Petrozavodsk Summer Session, August 2006