NOJ/95/main.c
Saturneric 52668c4122 Add.
2020-09-01 00:46:43 +08:00

17 lines
269 B
C

#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;
}