NOJ/95/main.c

17 lines
269 B
C
Raw Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
int main(void){
int n;
while(scanf("%d",&n) && ~n){
int last = 0, mile = 0;
for(int i = 0; i < n; i++){
int now, speed;
scanf("%d %d",&speed,&now);
mile += speed * (now-last);
last = now;
}
printf("%d\n",mile);
}
return 0;
}