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>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int inf=2e9;
int n, j, r, t;
ll A[1010];
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n>>j>>r>>t;
assert(n<=1000 && t<=3000);
for(int i=1; i<=n; i++) A[i]=j;
for(int _=1; _<=t; _++){
for(int i=n-1; i>=1; i--){
int x=(A[i]+r-1)/r;
A[i+1]+=x, A[i]-=x;
}
}
for(int i=1; i<=n; i++) cout<<A[i]<<'\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |