ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

1475. Ryaba Hen

Time limit: 3.0 second
Memory limit: 64 MB
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.
Problem illustration
The left lower vertex of the isosceles triangle on the picture has coordinates (0, 0). The mouse climbed along the slope up to the point (l, 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 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 (l, H) is not the uppermost point of the roof.


The first line contains the number of tests N ≤ 1000. Each of the next N lines contains three integers H, l, and h; 1 ≤ H, l ≤ 10100, 1 ≤ h ≤ 10.


For each test, output in a separate line the number of dents on the egg.


1 2 1
1 2 10
Problem Author: Alexander Ipatov (idea of Alexander Toropov)
Problem Source: Ural SU and Orel STU Contest. Petrozavodsk Summer Session, August 2006