/* -*- coding: utf-8 -*- * * 2027.cc: No.2027 (1, 2, 3, …, N) 's Subset Sum - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ typedef long long ll; /* global variables */ int as[MAX_N]; /* subroutines */ /* main */ int main() { int n; ll s; scanf("%d%lld", &n, &s); int k = 0; for (int a = n; a >= 1; a--) if (s >= a) as[k++] = a, s -= a; printf("%d\n", k); for (int i = k - 1; i >= 0; i--) printf("%d%c", as[i], (i > 0) ? ' ' : '\n'); return 0; }