73092024-01-06 19:13:18gonterarminOszthatóság 31-gyelcpp17Accepted 50/503ms3768 KiB
#include <iostream>

using namespace std;

int main() {
    int n,m;
    cin >> n;
    m=n;
    while (n/10-(n%10*3)>0) {
        n = n/10-(n%10*3);
    }
    if (n%31==0) {
        cout << "IGEN"<<endl;
    } else {
        cout << "NEM"<<endl;
    }
    while (m/10-(m%10*3)>=0) {
        m = m/10-(m%10*3);
        cout<<m<<" ";
        if (m==0) {
            break;
        }
    }
    cout<<endl;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms2156 KiB
2Accepted0/03ms2280 KiB
3Accepted3/33ms2416 KiB
4Accepted3/33ms2536 KiB
5Accepted4/43ms2744 KiB
6Accepted4/43ms3112 KiB
7Accepted4/43ms3248 KiB
8Accepted4/43ms3392 KiB
9Accepted4/43ms3432 KiB
10Accepted4/43ms3532 KiB
11Accepted4/42ms3608 KiB
12Accepted4/42ms3728 KiB
13Accepted4/43ms3612 KiB
14Accepted4/43ms3612 KiB
15Accepted2/23ms3768 KiB
16Accepted2/23ms3748 KiB