Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Tjeez

Problemset: Slowly Express

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-10 00:14:24

#include <bits/stdc++.h>
using namespace std;
int main(){
	vector<int> v;
	int sm=0;
	while (true){
		int n; cin>>n;
		if (n<0) return 0;
		sm+=n;
		if (sm>=500){
			int car=0;
			while (sm>=500){
				if (sm>=800) sm-=800;
				else sm=0;
				car++;
			}
			cout<<car<<"\n";
		}
		else {
			cout<<0<<"\n";
		}
	}
}