/*input
5
1 2 2 3 4
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define f first
#define s second
inline pii mp(int a, int b)
{
pii temp;temp.f=a;temp.s=b;return temp;
}
int arr[101];
signed main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n;cin>>n;
for(int i=1;i<=n;i++)
{
cin>>arr[i];
}
int cur=arr[1];cout<<cur<<" ";
for(int i=2;i<=n;i++)
{
cout<<arr[i]*i - cur<<" ";cur=arr[i]*i;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
480 KB |
Output is correct |
3 |
Correct |
2 ms |
720 KB |
Output is correct |
4 |
Correct |
3 ms |
720 KB |
Output is correct |
5 |
Correct |
4 ms |
720 KB |
Output is correct |
6 |
Correct |
3 ms |
832 KB |
Output is correct |
7 |
Correct |
2 ms |
832 KB |
Output is correct |
8 |
Correct |
3 ms |
832 KB |
Output is correct |
9 |
Correct |
2 ms |
832 KB |
Output is correct |
10 |
Correct |
3 ms |
836 KB |
Output is correct |