讨厌的输入和输出
#include<cstdio>
typedef struct{
int index;
int time;
int crime;
int velocity;
int min,sec;
}aa;
aa team[1000];
int n,tot;
double d;
void detail(int index){
int i,mm,ss,v;
char h;
team[++tot].index=index;
for(i=1;i<=n;i++){
scanf(" %c",&h);
if(h=='-') {team[tot].crime=1;break;}
scanf(":%d:%d",&mm,&ss);
team[tot].time+=(h-'0')*3600+mm*60+ss;
}
v=(int)((double)team[tot].time/d+0.5);
team[tot].sec=v%60;
team[tot].min=v/60;
while(getchar()!='\n');
}
int main(){
int i;
scanf("%d %lf",&n,&d);
while(scanf("%d",&i)!=EOF) detail(i);
for(i=1;i<=tot;i++){
printf("%3d: ",team[i].index);
if(team[i].crime==1) printf("-\n");
else printf("%d:%02d min/km\n",team[i].min,team[i].sec);
}
return 0;
}