#include using namespace std; inline int read(){ int x=0,f=1;char cc=getchar(); while(cc<'0' || cc>'9') {if(cc=='-') f=-1;cc=getchar();} while(cc>='0' && cc<='9') {x=x*10+cc-'0';cc=getchar();} return x*f; } int n,f[1010],g[1010]; int x,y; inline int gcd(int a,int b){ while(b){ int r=a%b;a=b;b=r; } return a; } int main(){ for(int tt=read();tt;tt--){ n=read(); for(int i=0;i0) x=i; y=-1;for(int i=0;i0) y=i; if(xy){ printf("1/0\n");continue; } int z=gcd(f[x],g[y]); printf("%d/%d\n",f[x]/z,g[y]/z); } }