Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Sense.exe
Problemset: Slowly Express
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-08 20:30:44
#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 = num+cur;
}
cout << car << "\n";
}
}