#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>a>>b>>c>>d; int n; cin>>n; vector xs(n),ys(n); for(int i=0;i>xs[i]>>ys[i]; int gx=__gcd(a,c); int gy=__gcd(b,d); using P = pair; set

sp; for(int i=0;i