21882022-12-30 13:28:561478Oszthatóság 31-gyelcpp11Accepted 50/503ms4148 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

int main()
{
    // ifstream cin("be.txt");
    int n;
    cin >> n;

    vector<int> answers;
    n = n / 10 - 3 * (n % 10);
    while (n > 0)
    {
        answers.push_back(n);
        n = n / 10 - 3 * (n % 10);
    }

    if (n % 31 == 0)
    {
        if (n == 0)
        {
            answers.push_back(n);
        }
        cout << "IGEN" << endl;
    }
    else
    {
        cout << "NEM" << endl;
    }

    for (int i = 0; i < answers.size(); i++)
    {
        cout << answers[i] << " ";
    }
    
    cout << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1684 KiB
2Accepted0/02ms1848 KiB
3Accepted3/32ms2200 KiB
4Accepted3/32ms2264 KiB
5Accepted4/42ms2464 KiB
6Accepted4/42ms2672 KiB
7Accepted4/42ms2880 KiB
8Accepted4/42ms2956 KiB
9Accepted4/42ms3080 KiB
10Accepted4/42ms3152 KiB
11Accepted4/42ms3404 KiB
12Accepted4/42ms3652 KiB
13Accepted4/42ms3768 KiB
14Accepted4/42ms3904 KiB
15Accepted2/22ms3936 KiB
16Accepted2/22ms4148 KiB