20392022-12-15 13:47:41gkataOszthatóság 31-gyelcpp17Accepted 50/503ms4116 KiB
#include <iostream>
//#include <fstream>

using namespace std;

//ifstream cin("oszt.in");
//ofstream cout("oszt.out");

int a,r,k;

int main()
{
    cin>>a;
    k=a;
    while(k>=3*r)
    {
        r=k%10;
        k=k/10;
        k=k-(3*r);
    }

    if(k%31==0) cout<<"IGEN"<<"\n";
        else cout<<"NEM"<<"\n";

    while(a>0)
    {
        r=a%10;
        a=a/10;
        if(a>=(3*r))
        {
            a=a-(3*r);
            cout<<a<<" ";
        }
        else cout<<"\n";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1876 KiB
2Accepted0/02ms2120 KiB
3Accepted3/32ms2308 KiB
4Accepted3/32ms2388 KiB
5Accepted4/42ms2520 KiB
6Accepted4/42ms2684 KiB
7Accepted4/42ms2884 KiB
8Accepted4/42ms2960 KiB
9Accepted4/42ms3088 KiB
10Accepted4/42ms3288 KiB
11Accepted4/42ms3372 KiB
12Accepted4/42ms3508 KiB
13Accepted4/42ms3704 KiB
14Accepted4/42ms3912 KiB
15Accepted2/22ms3992 KiB
16Accepted2/22ms4116 KiB