inline ll gcd(ll a,ll b) { if(!b) return a; else { while(1) { ll t=a%b; if(t==0) return b; else { a=b; b=t; } } } }