CF1133A.Middle of the Contest

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Polycarp is going to participate in the contest. It starts at h1:m1h_1:m_1 and ends at h2:m2h_2:m_2. It is guaranteed that the contest lasts an even number of minutes (i.e. m1%2=m2%2m_1 \% 2 = m_2 \% 2, where x%yx \% y is xx modulo yy). It is also guaranteed that the entire contest is held during a single day. And finally it is guaranteed that the contest lasts at least two minutes.

Polycarp wants to know the time of the midpoint of the contest. For example, if the contest lasts from 10:0010:00 to 11:0011:00 then the answer is 10:3010:30, if the contest lasts from 11:1011:10 to 11:1211:12 then the answer is 11:1111:11.

Polycarp 将参加一场比赛。比赛开始于 h1:m1h_1:m_1,结束于 h2:m2h_2:m_2。题目保证比赛持续的总分钟数为偶数(即 m1%2=m2%2m_1 \% 2 = m_2 \% 2,其中 x%yx \% y 表示 xx 对 yy 取模)。同时保证整场比赛在同一天内举行。最后,还保证比赛至少持续两分钟。

Polycarp 想知道比赛时间的中点时刻。例如,若比赛从 10:0010:00 持续到 11:0011:00,则答案为 10:3010:30;若比赛从 11:1011:10 持续到 11:1211:12,则答案为 11:1111:11。

输入格式

The first line of the input contains two integers h1h_1 and m1m_1 in the format hh:mm.

The second line of the input contains two integers h2h_2 and m2m_2 in the same format (hh:mm).

It is guaranteed that 0≤h1,h2≤230 \le h_1, h_2 \le 23 and 0≤m1,m2≤590 \le m_1, m_2 \le 59.

It is guaranteed that the contest lasts an even number of minutes (i.e. m1%2=m2%2m_1 \% 2 = m_2 \% 2, where x%yx \% y is xx modulo yy). It is also guaranteed that the entire contest is held during a single day. And finally it is guaranteed that the contest lasts at least two minutes.

输入的第一行包含两个整数 h1h_1 和 m1m_1,格式为 hh:mm。

输入的第二行包含两个整数 h2h_2 和 m2m_2,格式同上(hh:mm)。

保证 0≤h1,h2≤230 \le h_1, h_2 \le 23 且 0≤m1,m2≤590 \le m_1, m_2 \le 59。

保证比赛持续时间为偶数分钟(即 m1%2=m2%2m_1 \% 2 = m_2 \% 2,其中 x%yx \% y 表示 xx 对 yy 取模)。同时保证整场比赛在同一天内举行。最后,保证比赛持续时间至少为两分钟。

输出格式

Print two integers h3h_3 and m3m_3 (0≤h3≤23,0≤m3≤590 \le h_3 \le 23, 0 \le m_3 \le 59) corresponding to the midpoint of the contest in the format hh:mm. Print each number as exactly two digits (prepend a number with leading zero if needed), separate them with ':'.

输出两个整数 h3h_3 和 m3m_3(0≤h3≤230 \le h_3 \le 23,0≤m3≤590 \le m_3 \le 59),表示比赛的中点时刻,格式为 hh:mm。每个数字均需恰好输出两位(若不足两位,则在前面补零),并用 : 分隔。

输入输出样例

  • 输入#1

    10:00
    11:00

    输出#1

    10:30
  • 输入#2

    11:10
    11:12

    输出#2

    11:11
  • 输入#3

    01:02
    03:02

    输出#3

    02:02

输入解题思路,AI测评打分。不知道怎么写?

首页