Logo
(追記) (追記ここまで)

31362번 - Nano alarm-clocks 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB43301553.571%

문제

An old watchmaker has $n$ stopped nano alarm-clocks numbered with integers from 1ドル$ to $n$. Nano alarm-clocks count time in hours, and in one hour there are million minutes, each minute lasting a million seconds. In order to repair them all the watchmaker should synchronize the time on all nano alarm-clocks. In order to do this he moves clock hands a certain time forward (may be zero time). Let’s name this time shift a transfer time.

Your task is to calculate the minimal total transfer time required for all nano alarm-clocks to show the same time.

입력

The first line contains a single integer $n$ --- the number of nano alarm-clocks (2ドル \le n \le 10^5$). In each $i$-th of the next $n$ lines the time $h,ドル $m,ドル $s,ドル shown on the $i$-th clock. Integers $h,ドル $m$ and $s$ show the number of hours, minutes and seconds respectively. (0ドル \le h < 12,ドル 0ドル \le m < 10^6,ドル 0ドル \le s < 10^6$).

출력

Output three integers separated with spaces $h,ドル $m$ and $s$ --- total minimal transfer time, where $h,ドル $m$ and $s$ --- number of hours, minutes and seconds respectively (0ドル \le m < 10^6,ドル 0ドル \le s < 10^6$).

제한

예제 입력 1

2
10 0 0
3 0 0

예제 출력 1

5 0 0

예제 입력 2

3
11 999999 999999
0 0 0
11 999999 999999

예제 출력 2

0 0 2

힌트

출처

Contest > Open Cup > 2014/2015 Season > Stage 11: Grand Prix of Tatarstan > Division 1 G번

Contest > Open Cup > 2014/2015 Season > Stage 11: Grand Prix of Tatarstan > Division 2 G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /