Submission

Status:

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

Subtask/Task Score:

45/100

Score: 45

User: Whatthepoop

Problemset: Slowly Express

Language: c

Time: 0.003 second

Submitted On: 2025-10-12 23:16:50

#include <stdio.h>

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

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

        stock += num;
        if(stock >= 800){
            car += stock/800;
            stock %= 800;
            if(stock > 500){
                car += stock/500;
                stock %= 500;
            }
        }
        else if(stock > 500){
            car += stock/500;
            stock %= 500;
        }
        printf("%d\n", car);
    }

    return 0;
}