ll@N,@M,m=0,a=0,x;if(N<2)wt("NaN");else{while(M){a++,x=a*a;while(x>m*m*N)m++;M-=m*m*N>=x+2a+1;}wt(a);}