local n, s = io.read("*n", "*n") local t = {} for i = n, 1, -1 do if i <= s then table.insert(t, i) s = s - i end end for i = 1, #t do local j = #t + 1 - i if j <= i then break end t[i], t[j] = t[j], t[i] end print(#t) print(table.concat(t, " "))