#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]; if(a*d-b*c==0){ Int dx=__gcd(a,c); Int dy=__gcd(b,d); if(dx==0) dx=2e9; if(dy==0) dy=2e9; using P = pair; set

sp; for(Int i=0;i; set

sp; for(Int i=0;i