#include using namespace std; #define reg register typedef long long ll; #define rep(i,a,b) for(int i=a,i##end=b;i<=i##end;++i) #define drep(i,a,b) for(int i=a,i##end=b;i>=i##end;--i) char IO; int rd(){ int s=0,f=0; while(!isdigit(IO=getchar())) if(IO=='-') f=1; do s=(s<<1)+(s<<3)+(IO^'0'); while(isdigit(IO=getchar())); return f?-s:s; } const int P=1e9+7; int gcd(int a,int b){ return b==0?a:gcd(b,a%b);} int main(){ rep(kase,1,rd()) { int n=rd(); int a=-1,b=-1,c,d; rep(i,0,n-1) { int t=rd(); if(t) a=i,c=t; } rep(i,0,n-1) { int t=rd(); if(t) b=i,d=t; } if(ab) puts("1/0"); else { int g=gcd(c,d); printf("%d/%d\n",c/g,d/g); } } }