int inv(int x) { if(x==1)return 1; return ((mod-mod/x)*inv(mod%x))%mod; }
int inv(int x) { return mul(x,mod-2);//快速幂模板 }