Submission #858373

#TimeUsernameProblemLanguageResultExecution timeMemory
858373votranngocvy평균 (COCI14_prosjek)C++14
50 / 50
1 ms600 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
const int N = 100 + 5;
ll a[N],b[N];

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> b[i];
    a[1] = b[1];
    ll sum = a[1];
    for (int i = 2; i <= n; i++) {
        a[i] = b[i] * i - sum;
        sum += a[i];
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...