1952021-02-06 10:43:52Molnár AttilaOszthatóság 31-gyelpython3Accepted 50/5037ms13332 KiB
from sys import stdin, stdout

s=0
r=0
l=[]

def oszt31():
  global l,s,r
  l.append(s)
  if (s<10):
    return s==0
  (s,r) = divmod(s,10)
  s-=3*r
  return oszt31()

def main():
  global l,s,r
  s = int(stdin.readline())
  b = oszt31()
  stdout.write('IGEN\n' if b else 'NEM\n')

  for e in l[1:]:
    if (0<=e):
      stdout.write(f'{e} ')
  if not b:
    stdout.write('\n')

main()
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/037ms13264 KiB
2Accepted0/029ms13208 KiB
3Accepted3/329ms13268 KiB
4Accepted3/328ms13316 KiB
5Accepted4/428ms13332 KiB
6Accepted4/428ms13272 KiB
7Accepted4/428ms13276 KiB
8Accepted4/428ms13164 KiB
9Accepted4/428ms13244 KiB
10Accepted4/428ms13276 KiB
11Accepted4/430ms13276 KiB
12Accepted4/434ms13264 KiB
13Accepted4/434ms13268 KiB
14Accepted4/427ms13332 KiB
15Accepted2/228ms13228 KiB
16Accepted2/234ms13236 KiB