Walk
시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2014-15 openBOJ 7189
문제
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 (1 ≤ N ≤ 10\,000) and each of the subsequent lines contains the following (space-separated) data about one segment:
- the duration of the segment in minutes and seconds in the form
ms, where is the integer number of minutes (and the minutes part is omitted for times less than a minute) and 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
ms/km, where is the integer number of minutes and is the integer number of seconds (which never exceeds ), 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 hours.
출력
The output should contain two lines
- on the first line the total distance of the walk, rounded to metres, in the form
m, where is the integer number of metres; - on the second line the average speed in the form
km/h, where is a real number; the output value must not differ from the correct answer by more than .
예제
예제 1
입력
3 8m30s kiirusega 9m10s/km 4m10s kiirusega 8m1s/km 21s kiirusega 4m10s/km
출력
1531m 7.057km/h
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.