14112022-09-04 20:27:48ncsOszthatóság 31-gyelpython3Accepted 50/5017ms13224 KiB
# 31-el oszthato
def solve(n):
  ret=[n]
  while True:
    x,r=divmod(ret[-1],10)
    x-=3*r
    if x<0: break
    ret.append(x)
    if x==0:break
  print(["IGEN","NEM"][(ret[-1]%31>0)])
  print(" ".join(str(x) for x in ret[1:]))

solve(int(input()))
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/017ms11356 KiB
2Accepted0/017ms11348 KiB
3Accepted3/317ms11532 KiB
4Accepted3/317ms11868 KiB
5Accepted4/417ms12008 KiB
6Accepted4/417ms11724 KiB
7Accepted4/417ms12260 KiB
8Accepted4/417ms12524 KiB
9Accepted4/417ms12456 KiB
10Accepted4/417ms12508 KiB
11Accepted4/417ms12936 KiB
12Accepted4/417ms12956 KiB
13Accepted4/417ms13060 KiB
14Accepted4/417ms13076 KiB
15Accepted2/217ms13224 KiB
16Accepted2/217ms13064 KiB