Олимпиадный тренинг

Задача 33579. Watch


Задача

Темы: Целые числа

The clock ran out of battery and started running at half the speed. When the clock had x1 hours y1 minutes, the correct time was a1 hours b1 minutes. What time will it actually be the next time the clock shows x2 hours y2 minutes?

Input The program receives the numbers x1, y1, a1, b1, x2, y2 as input in the specified order. All numbers are integers. Numbers x1, a1, x2 — from 0 to 23, numbers y1, b1, y2 — from 0 to 59. All numbers are entered one per line

Output Print two integers a2 and b2 that determine how much time it will actually be when the clock is x2 hours y2 minutes. Output numbers in one line separated by spaces
 

# Input Output
1 12
34
10
34
12
35
10 36

Запрещенные операторы:if;for;while;do;max