快速幂模板 inline ll ksm(ll a,ll b){ ll res=1; while(b){ if(b&1) res=res%mo*a%mo; a=a%mo*a%mo; b>>=1; } return res; }