Submission

Status:

------P-------------

Subtask/Task Score:

5/100

Score: 5

User: letdown

Problemset: Slowly Express

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-10 09:24:06

#include <iostream>

using namespace std;
int main() {
    int n, l=0;
    while (1) {
        cin >> n;
        if (n < 0) return 0;
        n+=l;
        if (n >= 500) {
            int left = n % 800;
            cout << int(n / 800) + (left / 800 + 1) << endl;
            l = 0;
            if (left < 500) {
                l += left;
            }
        } else {
            l += n;
            cout << 0 << endl;
        };
    }
}