Submission

Status:

PPP---P----P---PP--P

Score: 40

User: Pera

Problemset: Slowly Express

Language: cpp

Time: 0.002 second

Submitted On: 2025-05-18 18:32:54

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    
    int carry_over = 0;
    
    while (true) {
        int n; cin >> n;
        if (n > 0) {
            int value = carry_over + n;

            int count = value / 800;
            value = value - 800 * count;

            if (value % 800 >= 500) {
                count++;
                value = 0;
            }

            cout << count << '\n';
            carry_over = value;
        } else break;
    }
}