Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: loop

Problemset: Slowly Express

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-10 18:32:39

#include <iostream>
using namespace std;

int main() {
    long long w, wait = 0;
    while (cin >> w && w >= 0) {
        long long total = wait + w, cars = 0;
        if (total >= 500) {
            cars = total / 800;
            long long rest = total % 800;
            if (rest >= 500) { cars++; rest = 0; }
            wait = rest;
        } else {
            wait = total;
        }
        cout << cars << '\n';
    }
    return 0;
}