ll@n,@b; if(n--%2){ wt(n/2); }else if(b%2){ ll p=EulerPhi(b); wt(powmod(2,p-1,b)*n%b); }else{ wt("NaN"); }