Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: nicekrittaphat
Problemset: Slowly Express
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-13 20:09:55
#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>=500){
car = res/800+1;
res = 0;
}
else{
car = res/800;
res %= 800;
}
}
cout<<car<<endl;
now = 0;
cin>>now;
}
}