#include using namespace std; int main() { int N; long long K; cin >> N >> K; vectorsum(N+1); for(int i = 0; i < N; i++) { sum[i+1] = sum[i]+i+1; } for(int i = 0; i < N; i++) { int it = lower_bound(sum.begin(),sum.end(),sum[i]+(sum[N]-K))-sum.begin(); if(it <= N && sum[it] == sum[i]+(sum[N]-K)) { cout << 1 << endl; return 0; } } cout << 2 << endl; }