local mfl, mce = math.floor, math.ceil local n, m = io.read("*n", "*n") local t = {} while true do local v = mfl(n / m) table.insert(t, v) if n % m == 0 then break end local rem = n - m * v n, m = m, rem end print(table.concat(t, " "))