Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: pann

Problemset: Slowly Express

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-09 01:47:10

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int total = 0, n;
    vector<int> a;
    while (true){
        cin >> n;
        if (n < 0) break;
        total += n;
        int count = 0;
        while (total != 0){
            if (total >= 800){
                total -= 800;
                count++;
            }
            else if (total >= 500){
                total = 0;
                count++;
            }
            else break;
        }
        cout << count << "\n";
        }
    return 0;
}