#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N>>K; for(ll l=1;l<=N;l++){ ll a=l-1,b=3*N; while(b-a>1){ ll c=(a+b)/2; ll sum=(l+c)*(c-l+1)/2; if(sum>=N*(N+1)/2-K) b=c; else a=c; } if(b<=N&&(l+b)*(b-l+1)/2==N*(N+1)/2-K){ cout<<1<