fork download
  1. def func(x)
  2. n=x/3
  3. n+=1 if n*3!=x
  4. r=1
  5. while n>0
  6. w=x/n
  7. r*=w
  8. x-=w
  9. n-=1
  10. end
  11. r
  12. end
  13.  
  14. p func(10)
  15. p func(64)
  16. p func(100)
  17. p func(99) # 5559060566555523
Success #stdin #stdout 0.02s 7412KB
stdin
Standard input is empty
stdout
36
13947137604
7412080755407364
5559060566555523