Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: Slowly Express
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-15 09:45:15
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int w, r = 0;
while(cin >> w && w >= 0) {
int ans = 0;
w += r;
if(w >= 800) {
ans += w / 800;
w %= 800;
}
if(w >= 500) {
ans += w / 500;
w = 0;
}
r = w;
cout << ans << endl;
}
return 0;
}