#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin>>n;
long long niza[n];
for(long long i=0; i<n; i++)
{
cin>>niza[i];
}
vector<long long> res;
res.push_back(niza[0]);
long long sum=niza[0];
for(long long i=1; i<n; i++)
{
long long passed=i+1;
long long tmp=niza[i]*passed-sum;
res.push_back(tmp);
sum+=tmp;
}
for(auto x:res)cout<<x<<" ";
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |