71482023-12-31 14:28:46xxxKártya (80 pont)cpp17Accepted 80/803ms4184 KiB
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    for(int &i : a) {
        cin >> i;
        sum += i;
    }

    if ((sum / n) * n != sum) {
        cout << "NEM\n";
        cout << n - (sum % n) << '\n';
        return;
    }

    cout << "IGEN\n";
    int OK = sum / n;
    for(int i : a) {

        if (i > OK) {
            cout << i - OK << ' ';
        } else {
            cout << 0 << ' ';
        }
    }

}

int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int tt=1;
	//cin >> tt;
	while(tt--) {
        solve();
	}


	return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1976 KiB
2Accepted0/03ms2184 KiB
3Accepted4/43ms2332 KiB
4Accepted5/53ms2548 KiB
5Accepted5/53ms2604 KiB
6Accepted5/53ms2732 KiB
7Accepted5/53ms2944 KiB
8Accepted4/43ms3156 KiB
9Accepted4/43ms3364 KiB
10Accepted5/53ms3428 KiB
11Accepted5/53ms3556 KiB
12Accepted5/53ms3656 KiB
13Accepted6/63ms3648 KiB
14Accepted6/63ms3784 KiB
15Accepted7/73ms3992 KiB
16Accepted7/73ms4096 KiB
17Accepted7/73ms4184 KiB