fork download
  1. n=int(input())
  2. a=[]
  3. for L in range(1,n+1):
  4. t=L-sum(a)%L
  5. while t in a:t+=L
  6. a+=[t]
  7. print(a[-1])
Success #stdin #stdout 0.86s 9992KB
stdin
10000
stdout
16180