742021-01-10 11:06:04Tiszay DávidOszthatóság 37-telcpp11Accepted 40/402ms1844 KiB
#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define flog(n) 31-__builtin_clz((n))
#define clog(n) 32-__builtin_clz((n)-1)
#define fori(i,a,b) for(long long int i=(a);i<=(b);i++)
#define forib(i,a,b) for(long long int i=(a);i>=(b);i--)
using ll=long long; using pi=pair<int,int>; using vi=vector<int>; using vl=vector<ll>;


void solve(){
  ll n; cin >> n;
  bool ok = false;
  vl curr;
  while (true){
    ll m = n % 10;
    ll neu = n / 10 - m * 11;
    if (neu <= 0){
        if (neu == 0){
            curr.pb(neu);
        }
        if (n % 37 == 0){
            ok = true;
        }
        break;
    }
    n = neu;
    curr.pb(neu);
  }
  cout << (ok ? "IGEN" : "NEM") << endl;
  if (curr.size() > 0){
    fori(i, 0, curr.size() - 1){
          cout << curr[i] << " ";
      }
  }
  cout << endl;
}
int main() {
  if(true){ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
  solve();
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/02ms1756 KiB
2Accepted0/01ms1780 KiB
3Accepted3/31ms1840 KiB
4Accepted3/31ms1844 KiB
5Accepted3/31ms1836 KiB
6Accepted3/31ms1844 KiB
7Accepted3/31ms1840 KiB
8Accepted3/31ms1840 KiB
9Accepted3/31ms1840 KiB
10Accepted3/31ms1840 KiB
11Accepted3/31ms1836 KiB
12Accepted3/31ms1836 KiB
13Accepted3/31ms1840 KiB
14Accepted3/31ms1840 KiB
15Accepted2/21ms1840 KiB
16Accepted2/21ms1840 KiB