111452024-07-07 16:31:10probaKártya (80 pont)python3Accepted 80/8018ms3196 KiB
N = int(input())
lap = [int(i) for i in input().split(' ')]
slap = sum(lap)
tort = slap/N
egesz = slap//N

verdict = (tort == egesz )*'IGEN'+(tort != egesz)*'NEM'
print(verdict)

if verdict == 'IGEN':
    ajandek = []
    for i in lap:
        if i>tort:
            ajandek += [int(i-tort)]
        else:
            ajandek += [0]

    print(' '.join([str(i) for i in ajandek]))
    
else:
    print((egesz+1)*N-slap)
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/018ms3044 KiB
2Accepted0/017ms3044 KiB
3Accepted4/417ms3044 KiB
4Accepted5/517ms2960 KiB
5Accepted5/517ms2916 KiB
6Accepted5/517ms2948 KiB
7Accepted5/517ms2992 KiB
8Accepted4/417ms3196 KiB
9Accepted4/417ms3044 KiB
10Accepted5/517ms3088 KiB
11Accepted5/517ms3044 KiB
12Accepted5/517ms3188 KiB
13Accepted6/617ms3104 KiB
14Accepted6/618ms3192 KiB
15Accepted7/718ms3088 KiB
16Accepted7/717ms3172 KiB
17Accepted7/717ms3064 KiB