#include using namespace std; int main(){ int N; long S; scanf("%d %ld",&N,&S); long x = 1; while(1){ if(x*(x-1)/2 < S && S <= x*(x+1)/2){ break; } x++; } if(S == x*(x+1)/2){ printf("%d\n",x); } else { printf("%d\n",x-1); } for(long i=1;i<=x;i++){ if(i != x*(x+1)/2 - S){ printf("%ld ",i); } } }