56022023-08-02 13:54:21TomaSajtKártya (80 pont)cpp17Accepted 80/803ms3932 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n;
  cin >> n;

  vector<int> a(n);
  for (auto& ai : a) cin >> ai;

  int sum = accumulate(a.begin(), a.end(), 0);

  if (sum % n != 0) {
    cout << "NEM\n";
    cout << n - (sum % n);
    return 0;
  }

  cout << "IGEN\n";

  int avg = sum / n;

  for (auto& ai : a) {
    cout << max(ai - avg, 0) << ' ';
  }
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1828 KiB
2Accepted0/03ms1876 KiB
3Accepted4/43ms2096 KiB
4Accepted5/53ms2320 KiB
5Accepted5/53ms2544 KiB
6Accepted5/53ms2768 KiB
7Accepted5/53ms2992 KiB
8Accepted4/42ms3052 KiB
9Accepted4/43ms3180 KiB
10Accepted5/53ms3268 KiB
11Accepted5/53ms3276 KiB
12Accepted5/53ms3492 KiB
13Accepted6/63ms3496 KiB
14Accepted6/63ms3636 KiB
15Accepted7/73ms3720 KiB
16Accepted7/73ms3832 KiB
17Accepted7/73ms3932 KiB