fork(5) download
  1. f=->s,c,a{m=s.to_i;c<2?m<s||(p a+[m];exit):(1+m...c*s).map{|k|f[s/(1-s/k),c-1,a+[k]]}}
  2. f[gets.to_r/4,3,[]]
Success #stdin #stdout 0.01s 7472KB
stdin
999983
stdout
[249996, 249991750069, 62495875102311369754692]