60432023-10-28 19:09:08tomi7Kártya (80 pont)cpp11Accepted 80/803ms4180 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
	cin>>n;
	vector<int> a(n);
	int osszeg=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		osszeg+=a[i];
	}
	if(osszeg%n==0){
		cout<<"IGEN"<<'\n';
		int atlag=osszeg/n;
		for(int i=0;i<n;i++){
			if(a[i]<=atlag){
				cout<<0<<' ';
			}else{
				cout<<a[i]-atlag<<' ';
			}
		}
	}else{
		cout<<"NEM"<<'\n';
		cout<<n-(osszeg%n)<<'\n';
	}
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1816 KiB
2Accepted0/03ms2004 KiB
3Accepted4/43ms2220 KiB
4Accepted5/53ms2472 KiB
5Accepted5/53ms2656 KiB
6Accepted5/53ms2868 KiB
7Accepted5/52ms2960 KiB
8Accepted4/43ms3088 KiB
9Accepted4/43ms3212 KiB
10Accepted5/53ms3412 KiB
11Accepted5/53ms3624 KiB
12Accepted5/53ms3848 KiB
13Accepted6/63ms3932 KiB
14Accepted6/63ms4048 KiB
15Accepted7/73ms4064 KiB
16Accepted7/73ms4056 KiB
17Accepted7/73ms4180 KiB