제출 #396585

#제출 시각아이디문제언어결과실행 시간메모리
396585mewnian평균 (COCI14_prosjek)C++17
50 / 50
1 ms320 KiB
#include <bits/stdc++.h>
#define sze(x) (ll)x.size()
#define idx(x, a) get<x>(a)
#define pb push_back
#define fi first
#define se second

using namespace std;

typedef long long ll;

const ll MAXN = 103;

ll a[MAXN], b[MAXN], n;

int main()
{
    ios_base::sync_with_stdio(0); cout.tie(0);
    #ifdef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    cin >> n;
    for (ll i = 0; i < n; ++i) cin >> b[i];
    ll sum = 0;
    for (ll i = 0; i < n; sum += a[i++])
    {
        a[i] = b[i] * (i + 1) - sum;
        cout << a[i] << ' ';
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...