def lscan; gets.split.map(&:to_i); end n, h = lscan div = (1..n).filter{|x| n/x*x == n}.to_a # p div if h >= 3 p -1 exit end la = div.pop print (la.to_s + ' ')*la puts if h == 2 div.each do |d| print (d.to_s + ' ')*d end