Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Whatthepoop

Problemset: Slowly Express

Language: c

Time: 0.002 second

Submitted On: 2025-10-12 23:25:00

#include <stdio.h>

int main() {
    long long stock = 0, num;
    int car;

    while (1) {
        scanf("%lld", &num);
        if (num < 0) break;

        stock += num;
        car = 0;

        if (stock >= 800) {
            car += stock / 800;
            stock %= 800;
        }

        if (stock >= 500) {
            car++;
            stock = 0;
        }

        printf("%d\n", car);
    }

    return 0;
}