fork(1) download
  1. n=1
  2.  
  3. require'date'
  4. f=->{d=Date.today
  5. (s=d.strftime('%Y%m%d').to_i
  6. return s if s%n<1
  7. d-=1)while d.year>0
  8. -1}
  9.  
  10.  
  11. n=4
  12. puts f[]
  13.  
  14. n=7
  15. puts f[]
  16.  
  17. n=90000
  18. puts f[]
  19.  
  20.  
Success #stdin #stdout 1.98s 7804KB
stdin
Standard input is empty
stdout
20140728
20140729
-1