111422024-07-07 16:03:42probaKártya (80 pont)python3Accepted 80/8029ms3192 KiB
N = int(input())

lap = [int(i) for i in input().split(' ')]

verdict = (sum(lap)/N==sum(lap)//N )*'IGEN'+( sum(lap)/N!=sum(lap)//N )*'NEM'
print(verdict)
if verdict == 'IGEN':
    ajandek = []
    for i in lap:
        ajandek += [int(i-sum(lap)/N)] if i>sum(lap)/N else [0]

    print(' '.join([str(i) for i in ajandek]))
else:
    print(((sum(lap)//N)+1)*N-sum(lap))
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/018ms2916 KiB
2Accepted0/017ms3088 KiB
3Accepted4/417ms3044 KiB
4Accepted5/517ms2968 KiB
5Accepted5/517ms2952 KiB
6Accepted5/517ms3056 KiB
7Accepted5/517ms3044 KiB
8Accepted4/417ms2920 KiB
9Accepted4/418ms2844 KiB
10Accepted5/517ms3044 KiB
11Accepted5/519ms3068 KiB
12Accepted5/518ms3044 KiB
13Accepted6/629ms3064 KiB
14Accepted6/617ms2972 KiB
15Accepted7/728ms3172 KiB
16Accepted7/717ms3192 KiB
17Accepted7/728ms3088 KiB