This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define dbgv(v) {for(auto x:v)cout<<x<<' ';cout<<'\n';}
#define entire(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
void OJize(){
cin.tie(NULL); ios_base::sync_with_stdio(false);
#ifdef jh
freopen("input.txt", "r", stdin);
#endif
}
int main(){OJize();
int n, j, r, t; cin>>n>>j>>r>>t;
vector<int> drink(n, j);
for(int time=0; time<t; time++){
for(int i=n-2; i>=0; i--){
int movedown = drink[i]/r;
if(drink[i]%r) movedown++;
drink[i]-= movedown;
drink[i+1]+= movedown;
}
}
for(int x: drink) cout<<x<<'\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |