Submission
Status:
PPP--P-----PP--PP---
Subtask/Task Score:
40/100
Score: 40
User: Sense.exe
Problemset: Slowly Express
Language: cpp
Time: 0.006 second
Submitted On: 2026-10-08 20:27:53
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int num=0,cur=0,car,total;
while(num>=0) {
cin >> num;
if(num<0) {
return 0;
}
car = 0;
if(num+cur>=500) {
total = num+cur;
car+=total/800;
cur = total%800;
if(cur>=500) {
car++;
cur = 0;
}
}
else {
cur = total%800;
}
cout << car << "\n";
}
}