Submission
Status:
-P---PP-P--P-P-PPPPP
Subtask/Task Score:
55/100
Score: 55
User: nicekrittaphat
Problemset: Slowly Express
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-13 20:05:47
#include<iostream>
using namespace std;
int main(){
int res=0;
int now=0;
cin>>now;
while(now>=0){
int car=0;
res += now;
if(res>=500){
if(res%800>=400){
car = res/800+1;
res = 0;
}
else{
car = res/800;
res %= 800;
}
}
cout<<car<<endl;
now = 0;
cin>>now;
}
}