long long qpow(long long n,long long k,long long m) { long long ans = 1; long lon g nn = n % m; while(k>0) { if(k&1) ans =ans * nn % m; nn = nn * nn % m; k>>=1; } return ans; }