25352023-01-16 18:28:58szabosamuelKártya (80 pont)cpp11Accepted 80/803ms3948 KiB
#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int k[n+1];
    for(int i=1; i<=n; i++)
    {
        cin >> k[i];
    }
    int sum=0;
    for(int i=1; i<=n; i++)
    {
        sum+=k[i];
    }
    if(sum%n==0) cout << "IGEN" << endl;
    else cout << "NEM" << endl;
    if(sum%n==0)
    {
        int atl=sum/n;
        for(int i=1; i<=n; i++)
        {
            if(k[i]-atl>0)k[i]=k[i]-atl;
            else k[i]=0;
        }
        for(int i=1; i<=n; i++)
        {
            cout << k[i] << " ";
        }
    }
    else
    {
        int kell=sum%n;
        kell=n-kell;
        cout << kell;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1876 KiB
2Accepted0/02ms2064 KiB
3Accepted4/42ms2172 KiB
4Accepted5/52ms2372 KiB
5Accepted5/52ms2580 KiB
6Accepted5/52ms2800 KiB
7Accepted5/52ms2848 KiB
8Accepted4/42ms3100 KiB
9Accepted4/42ms3256 KiB
10Accepted5/52ms3380 KiB
11Accepted5/52ms3504 KiB
12Accepted5/52ms3584 KiB
13Accepted6/62ms3584 KiB
14Accepted6/62ms3540 KiB
15Accepted7/72ms3668 KiB
16Accepted7/72ms3872 KiB
17Accepted7/73ms3948 KiB