Submission

Status:

-PP--PP-P--P-P--PP--

Subtask/Task Score:

45/100

Score: 45

User: Bestzu

Problemset: Slowly Express

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-15 09:27:46

#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 %= 500;
		}
        r = w;
        cout << ans << endl;
    }
    
    return 0;
}