We’re preparing your current view and syncing the latest data.
Polycarpus has an exam at a certain hour of the day. He plans to study for a set number of hours before the exam. His alarm clock is set with a certain number of hours he has left to sleep before he wakes up. However, he can hit the snooze cell phone button multiple times, each snooze decreasing the number of 'hours left' to sleep by some fixed amount. The question is, what is the earliest hour Polycarpus can wake up so that he has enough study hours before the exam?
The input consists of three integers: h (the exam hour), a (the minimum study hours Polycarpus wants), and b (the initial alarm setting in hours).
Output the earliest possible hour Polycarpus can wake up (in hours, 0 to 23) such that the number of hours before the exam is at least a.
0 ≤ h,a,b ≤ 23