ZOJ Problem Set - 3515
It is now the 30th century and in kingdom ToT, there is a very strong air defending system that there is a fighter plane set in every grid point (x, y) (where x, y ≥ 0. Regard it as a 2-D plane where y = 0 is ground and y denotes altitude). It is almost all-conquering.
But after a placid night, the news that all fighter plane with y ≤ x are all destroyed is reported which shocks the king of ToT. While on the other hand, kingdom TvT, the neighbour of ToT, at the same time as the criminal is planning a new attack.
The new attack is described like this. A super weapon is placed on the point (0, H), which is on the border of the two kingdoms. When it is launched, it will fly along the direction toward (X, Y). It will destroy all the fighter plane right below it or it passes. So please calculate the number of fighter plane it can destroy.
There are multiple cases (no more than 2000). For each case, there is only one line with three integers H, X, Y (0 ≤ H ≤ Y ≤ X ≤ 108) which are described above.
For each case, print one integer, the number of fighter plane it can destroy.
1 2 2 2 4 4
Author: ZHUANG, Junyuan
Contest: ZOJ Monthly, July 2011