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

7189번 - Walk 스페셜 저지다국어

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

문제

Mart takes a walk every day and his sports watch registers the duration and speed of each segment of uniform movement of his walk. After the walk, Mart can download a log file to his computer. Find the total distance and the average speed of the walk based on this file.

입력

The first line of input contains an integer $N$ (1ドル ≤ N ≤ 10,000円$) and each of the subsequent $N$ lines contains the following (space-separated) data about one segment:

  • the duration of the segment in minutes and seconds in the form $M$m$S$s, where $M$ is the integer number of minutes (and the minutes part is omitted for times less than a minute) and $S$ is the integer number of seconds (which never exceeds 59);
  • the word kiirusega;
  • the speed on this segment expressed as minutes and seconds per kilometre in the form $M$m$S$s/km, where $M$ is the integer number of minutes and $S$ is the integer number of seconds (which never exceeds 59ドル$), and you may assume Mart needs at least a minute, but less than an hour, per kilometre.

You may also assume that the total of the durations of all segments does not exceed 24ドル$ hours.

출력

The output should contain two lines

  • on the first line the total distance of the walk, rounded to metres, in the form $L$m, where $L$ is the integer number of metres;
  • on the second line the average speed in the form $V$km/h, where $V$ is a real number; the output value must not differ from the correct answer by more than 0ドル.001$.

제한

예제 입력 1

3
8m30s kiirusega 9m10s/km
4m10s kiirusega 8m1s/km
21s kiirusega 4m10s/km

예제 출력 1

1531m
7.057km/h

힌트

출처

Olympiad > Estonian Informatics Olympiad > 2014-15 > Open Competition 1번

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

출처

대학교 대회

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

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