Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: The3e

Problemset: Slowly Express

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-10 19:06:46

#include <iostream>
using namespace std;

int main() {
    int w;
    int rm = 0;
    
    while(cin >> w) {
        if (w < 0) 
            break;
            
        rm += w;
        
        int car = 0;
        while(rm >= 500) {
            if(rm >= 800) {
                rm -= 800;
                car++;
            }
            else {
                rm = 0;
                car++;
            }
        }
        cout << car << endl;
    }
    return 0;
}