Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Peam
Problemset: Slowly Express
Language: c
Time: 0.003 second
Submitted On: 2025-10-09 21:32:04
#include <stdio.h>
int main(){
int num, r1, r2;
int cnt = 0, idx = 0, new = 0, t = 0;
int arr[1000] = {0};
for(;;){
scanf("%d", &num);
if(num < 0){
break;
}
num+=new;
while(num >= 500){
num-=800;
cnt++;
if(num <= 800 && num >= 500){
num = 0;
cnt++;
}
}
if(num < 0){
num = 0;
}
arr[idx++] = cnt;
t++;
new = num;
cnt = 0;
}
for(int i = 0; i < t; i++){
printf("%d\n", arr[i]);
}
return 0;
}