#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
#define ins insert
#define pb push_back
#define F first
#define S second
const int N = 1e6 + 7, M = 5e5 + 7;
const int mod = 1e9 + 7;
void solve(){
int n;
cin>>n;
int a[n + 1], b[n + 1];
int cur = 0;
for(int i = 1; i <= n; i++){
cin>>a[i];
b[i] = a[i] * i - cur;
cur += b[i];
cout<<b[i]<<' ';
}
}
signed main(){
ios_base :: sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
//cin>>t;
for(int i = 1; i <= t; i++){
//cout<<"Case "<<i<<": ";
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |