Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: mik

Problemset: Slowly Express

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-11 14:29:42

#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false),cin.tie(NULL);
    int x=1,sum=0,c=0;
    while (x>=0){
        cin >> x;
        if (x<0) break;
        sum += x;
        if (sum>=500){
            while (sum>=500){
                if (sum>=800) {c++; sum-=800;}
                else {c++; sum=0;}
            }
        }
        cout << c << '\n';
        c = 0;
    }
    return 0;
}