#CCBCMCHIN0000043. Thời gian trận đấu có phút (Game Time with Minutes)
Thời gian trận đấu có phút (Game Time with Minutes)
Game Time with Minutes
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
A game runs on a 24-hour clock and may end on the following day. Its duration is from one minute to 24 hours; identical starting and ending times mean 24 hours. Output its hours and minutes.
Input
One line contains four integers : starting hour/minute and ending hour/minute.
Output
Print exactly O JOGO DUROU H HORA(S) E M MINUTO(S), where are the duration in hours and minutes.
Subtasks
Subtask 1 (20 points): Hours are in [0,23], minutes in [0,59], and the ending timestamp is strictly later. Subtask 2 (30 points): Hours are in [0,23], minutes in [0,59], and the ending timestamp is strictly earlier. Subtask 3 (50 points): Hours are in [0,23], minutes in [0,59], including equal timestamps.
Examples
Example 1
Input
7 10 8 9
Output
O JOGO DUROU 0 HORA(S) E 59 MINUTO(S)
Explanation
07:10 and 08:09 are 430 and 489 minutes; the difference is 59 minutes.
Example 2
Input
7 7 7 7
Output
O JOGO DUROU 24 HORA(S) E 0 MINUTO(S)
Explanation
Identical timestamps represent 1440 minutes, which is 24 hours.