#include typedef long double ld; int t,n; int a[100000]; int b[100000]; int main(){ std::ios::sync_with_stdio(false),std::cin.tie(0); std::cin >> t; while(t--){ std::cin >> n; for(int i=0;i> a[i]; for(int i=0;i> b[i]; int i1 = n,i2 = n; while(!a[--i1]); while(!b[--i2]); if(i1 < i2){ std::cout << 0 << '/' << 1 << '\n'; }else{ if(i1 > i2){ std::cout << 1 << '/' << 0 << '\n'; }else{ int x = a[i1],y = b[i2],z = std::__gcd(x,y); std::cout << x/z << '/' << y/z << '\n'; } } } }