(|n, m|{ if(m <= 1) return [[n]]; r: []; (n + 1).times{|x| callee(x, m - 1){ r.push_back([n - x] ~ it); } } return r; })(5, 3){ it.p; }