60442023-10-28 19:11:18IgnácKártya (80 pont)cpp11Accepted 80/803ms4016 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> a(N);
	int sum = 0;
	for(int i = 0; i < N; i++){
		cin >> a[i];
		sum += a[i];
	}
	
	if(sum % N == 0){ 
		cout << "IGEN\n";
		int average = sum / N;
		for(int i = 0; i < N; i++){
			if(a[i] > average){
				cout << a[i] - average << " ";
			}
			else{
				cout << 0 << " ";
			}
		}
	}
	else{
		cout << "NEM\n";
		cout << N - sum % N;
	} 

}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms2088 KiB
2Accepted0/03ms2236 KiB
3Accepted4/43ms2352 KiB
4Accepted5/53ms2508 KiB
5Accepted5/52ms2660 KiB
6Accepted5/53ms2840 KiB
7Accepted5/52ms2944 KiB
8Accepted4/42ms3072 KiB
9Accepted4/43ms3076 KiB
10Accepted5/53ms3260 KiB
11Accepted5/53ms3468 KiB
12Accepted5/53ms3864 KiB
13Accepted6/63ms3844 KiB
14Accepted6/63ms3784 KiB
15Accepted7/73ms4016 KiB
16Accepted7/73ms4016 KiB
17Accepted7/73ms3916 KiB