#P1425. 小鱼的游泳时间

小鱼的游泳时间

Description

The London Olympics are coming, and Little Fish is training hard for the swimming competition. Poor Little Fish doesn’t know that fish cannot participate in the human Olympics.

On this day, Little Fish measured its swimming time precisely (all timing in this problem uses the 2424-hour clock). It found that it swam from aa hours bb minutes to cc hours dd minutes on the same day. Please help Little Fish calculate how long it swam in total that day.

Little Fish worked really hard, so please don’t miscalculate.

Input Format

A single line contains four integers separated by spaces, representing a,b,c,da, b, c, d in the statement.

Output Format

Output two integers ee and ff in one line, separated by a space, indicating how many hours and minutes Little Fish swam in total that day. The minutes integer ff should be less than 6060.

12 50 19 10
6 20

Hint

For all testdata, 0a,c240 \le a, c \le 24, 0b,d600 \le b, d \le 60, and the end time is guaranteed to be later than the start time.

Translated by ChatGPT 5