7082021-11-18 20:09:53Valaki2Oszthatóság 31-gyelcpp14Accepted 50/503ms2096 KiB
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int x;
    cin >> x;
    bool ans;
    vector<int> steps;
    while(true) {
        x = (x / 10) - 3 * (x % 10);
        if(x == 0) {
            steps.push_back(x);
            ans = true;
            break;
        }
        if(x < 0) {
            if(x % 17 == 0) {
                ans = true;
            } else {
                ans = false;
            }
            break;
        }
        steps.push_back(x);
    }
    if(ans) {
        cout << "IGEN\n";
    } else {
        cout << "NEM\n";
    }
    for(int x : steps) {
        cout << x << " ";
    }
    cout << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms2028 KiB
2Accepted0/01ms2012 KiB
3Accepted3/31ms2040 KiB
4Accepted3/32ms2044 KiB
5Accepted4/41ms2052 KiB
6Accepted4/42ms2060 KiB
7Accepted4/42ms2060 KiB
8Accepted4/42ms2060 KiB
9Accepted4/42ms2064 KiB
10Accepted4/42ms2076 KiB
11Accepted4/42ms2076 KiB
12Accepted4/41ms2080 KiB
13Accepted4/41ms2084 KiB
14Accepted4/41ms2088 KiB
15Accepted2/21ms2092 KiB
16Accepted2/21ms2096 KiB