Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: porpeang

Problemset: Slowly Express

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-06 09:55:09

#include <bits/stdc++.h>
using namespace std;

int main(){
    int a=0,b=0,c=0,d=0,e=0,T=0;
    while(a>=0){
        cin>>a;
        if(a>=0){
            if(a==0){
                cout<<0<<'\n';
            }
            else if(T+a<500){
                T+=a;
                cout<<0<<'\n';
            
            }
            else{
                int rem = (T + a) % 800;
                if (rem >= 500) {
                    cout << ((T + a) / 800) + 1 << '\n';
                    T = 0;
                } else {
                    cout << (T + a) / 800 << '\n';
                    T = rem;
                }
            }
        }
        else{
            break;
        }
        
    }
}