#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>n; vector a(n); rep(i,n){ cin>>a[i]; } asi=a[0]; for(int i=1;i>n; vector b(n); rep(i,n){ cin>>b[i]; } rep(i,n){ if(i%2==0){ bsi*=b[i]; }else{ bbo*=b[i]; } } } bool neg=false; ll si=asi*bbo,bo=abo*bsi; if((si>0 and bo>0) or (si<0 and bo<0)); else neg=true; si=abs(si),bo=abs(bo); ll g=gcd(bo,si); si/=g;bo/=g; if(neg) si=-si; cout<