#A0207. 起床时间
起床时间
Title Description
It's winter vacation, and the excavator has started winter training. 33DAI has classes in the mornings these days.
Given that the class time is hour minute in the morning, 33DAI takes minutes from waking up to arriving at the classroom.
What is the latest time for 33DAI to wake up so as not to be late.
Input format
The first line consists of three integers
Output format
Output a line consisting of two integers , representing that the latest time for 33DAI to wake up is minutes when is required to avoid being late.
Please do not output extra leading , such as time '07:05', please output '75'.
8 0 50
7 10
10 30 25
10 5
Example explanation
- Example 1: The class starts at 08:00 and 33DAI takes minutes to arrive at school, so the latest wake-up time is 07:10.
- Example 2: The class time is 10:30, and 33DAI takes minutes to arrive at school, so the latest wake-up time is 10:05.
Data scale and agreement
For data of , , , .
-Subtask 1 (30 points): Ensure . -Subtask 2 (30 points): Ensure . -Subtask 3 (40 points): No special restrictions.