#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define vll vector<ll>
#define vii vector<pair<int,int>>
#define vlll vector<pair<ll,ll>>
#define all(x) x.begin(),x.end()
#define TESTCASES ll t;cin>>t;while(t--)
using namespace std;
int main()
{
ll n;cin>>n;
vll b(n+1);for(ll i=1;i<=n;i++){cin>>b[i];}
vll a(n+1);a[1]=b[1];
for(ll i=2;i<=n;i++){a[i]=i*b[i]-(i-1)*b[i-1];}
for(ll i=1;i<=n;i++){cout<<a[i]<<" ";}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |