#pragma region Template #include using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector; using vll = vector; using vvi = vector>; using vvll = vector>; using vvvi = vector>>; using vpi = vector>; using vpll = vector>; using vs = vector; using vb = vector; using pi = pair; using pll = pair; template using spq = priority_queue, greater>; template using gpq = priority_queue; #define fi first #define se second #define pb push_back #define fore(p,a) for (auto p : a) #define overload4(a,b,c,d,name,...) name #define rep1(n) for (ll i = 0; i < ll(n); ++i) #define rep2(i,n) for (ll i = 0; i < ll(n); ++i) #define rep3(i,a,b) for (ll i = a; i < ll(b); ++i) #define rep4(i,a,b,c) for (ll i = a; i < ll(b); i += c) #define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__) #define rrep1(n) for (ll i = n; i--;) #define rrep2(i,n) for (ll i = n; i--;) #define rrep3(i,a,b) for (ll i = b; i-- > (a);) #define rrep4(i,a,b,c) for (ll i = (a) + ((b) - (a) - 1) / (c) * (c); i >= (a); i -= c) #define rrep(...) overload4(__VA_ARGS__,rrep4,rrep3,rrep2,rrep1)(__VA_ARGS__) #define all(container) begin(container), end(container) #define rall(container) rbegin(container), rend(container) #define Vvll(name,row,column) vvll name(row, vll (column)) #define Max(...) max({__VA_ARGS__}) #define Min(...) min({__VA_ARGS__}) #define fin exit(0) #define FASTIO ios::sync_with_stdio(false); cin.tie(nullptr) #define FLOUT cout << setprecision(15) << fixed #ifdef LOCAL #define debug(x) cerr << "[DEBUG] " << __LINE__ << ": " << #x << " = " << x << endl #else #define debug(x) #endif constexpr int INF = 1001001001; constexpr ll LINF = 1LL << 60; const double PI = acos(-1); template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } ll fact(ll x) { return x == 0 ? 1 : x * fact(x - 1); } ll comb(ll n, ll r) { if (r < 0 || n < r) return 0; ll ret = 1; for (ll i = 1; i <= r; i++) { ret *= n; n--; ret /= i; } return ret; } // void prfl(double x) { printf("%.15f\n", x); } bool ise(ll x) { return x % 2 == 0; } bool dv(ll waru, ll warareru) { return warareru % waru == 0; } int ci(char c) { return c - '0'; } char ic(int i) { return '0' + i; } int Yes(bool f=1) { cout << (f ? "Yes" : "No") << '\n'; return 0; } int No() { Yes(0); return 0; } template int printvec(vector v) { for (int i = 0; i < (int) v.size(); i++) cout << (i ? " " : "") << v[i]; cout << '\n'; return 0; } #pragma endregion #include signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; ll s; cin >> n >> s; ll sm = 0; vi ans; for (int i = n; sm < s; i--) { if (sm + i <= s) sm += i, ans.push_back(i); } reverse(all(ans)); cout << ans.size() << '\n'; printvec(ans); }