408609: GYM103202 I Rise of Shadows
Description
Azeroth is a world full of fantasy. In Azeroth, there are $$$H$$$ hours in a day and $$$M$$$ minutes in an hour.
You found a clock made from Azeroth. The clock has two hands — the hour hand and the minute hand. The two hands point to the same direction at the start of a day. Either hand rotates at a constant speed. The hour hand goes around a full circle in $$$H$$$ hours and the minute hand goes around a full circle in $$$M$$$ minutes. Surprisingly, it is night in Azeroth if and only if the angle between the two hands is less than or equal to $$$\alpha$$$.
Now you're wondering, given $$$\alpha = \frac{2 \pi A}{HM}$$$, how many integral moments (i.e., integer minutes since the start of the day) are there, such that the angle between the two hands is less than or equal to $$$\alpha$$$.
InputThe only line of the input contains three integers $$$H, M$$$ $$$(2\le H, M \le 10^{9})$$$ and $$$A$$$ $$$(0 \le A \le \frac{HM}{2})$$$, representing the number of hours in a day and the number of minutes in an hour, and the limit of the angle in radians, respectively.
OutputPrint an integer representing the answer.
ExamplesInput5 5 4Output
9Input
3 5 1Output
3