Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Prap
Problemset: Slowly Express
Language: cpp
Time: 0.002 second
Submitted On: 2026-04-01 12:53:56
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
int main() {
int hol[100] = {0};
int loop = 0, N = 0;
while (loop == 0) {
cin>>hol[N];
if (hol[N] < 0) {
loop = 1;
N--;
}
N++;
}
int nig[N];
int wait = 0;
int hl;
int ans[N] = {0};
for (int i = 0; i<N; i++) {
nig[i] = hol[i];
}
for (int i = 0; i<N; i++) {
if (nig[i] + wait >= 500) {
// need to deliver
if (nig[i]+wait<=800) {
cout<<1<<endl;
wait = 0;
}
else {
hl = (nig[i]+wait - (nig[i]+wait)%800)/800;
wait = (nig[i]+wait)%800;
if (wait >= 500) {
hl++;
wait = 0;
}
cout<<hl<<endl;
}
}
else {
wait = nig[i] + wait;
cout<<0<<endl;
}
}
return 0;
}