def sol s,e,a,k,d if k == 0 if a.inject(:+) == d return a else return nil end else s.upto(e){|i| a.push(i) tmp = sol(i + 1,e,a,k - 1,d) if tmp return tmp end a.pop } return nil end end n,d,k = gets.split.map(&:to_i) if d < k * (k + 1) / 2 || d > (n * 2 - k + 1) * k / 2 p -1 else tmp = sol(1,n,[],k,d) if tmp puts tmp.join(' ') else p -1 end end