1
/**//**************************************
2
Problem: HEU 2023 Average is not Fast Enough!
3
Time: 0.0070 s
4
Memory: 260 k
5
Accepted Time: 2009-04-06 16:10:50
6
Tips: 还得加上0.5,满足精度
7
**************************************/
8
#include <stdio.h>
9
int main()
10

{
11
int n;
12
double d;
13
scanf("%d%lf",&n,&d);
14
int t;
15
while(scanf("%d",&t)!=EOF)
16
{
17
int i,flag=1,hour,min,sec;
18
char temp[20];
19
hour=min=sec=0;
20
for(i=0;i<n;i++)
21
{
22
scanf("%s",temp);
23
if(flag==1)
24
{
25
if(temp[0]=='-')flag=0;
26
else
27
{
28
int hh,mm,ss;
29
sscanf(temp,"%d:%d:%d",&hh,&mm,&ss);
30
hour+=hh;
31
min+=mm;
32
sec+=ss;
33
}
34
}
35
}
36
printf("%3d: ",t);
37
if(flag==0)printf("-\n");
38
else
39
{
40
double sum=hour*60*60+min*60+sec;
41
sum/=d;
42
sum+=0.5;
43
int aa=(int)sum/60;
44
int bb=(int)(sum-60*aa);
45
printf("%d:%02d min/km\n",aa,bb);
46
}
47
}
48
return 0;
49
}
50


2

3

4

5

6

7

8

9

10



11

12

13

14

15

16



17

18

19

20

21



22

23

24



25

26

27



28

29

30

31

32

33

34

35

36

37

38

39



40

41

42

43

44

45

46

47

48

49

50
