#include using namespace std; typedef long long ll; const int maxn=1e6; int t,n,x; int a[1050]; int b[1050]; int measure(int x, int y) { int z = y; while(x%y!=0) { z = x%y; x = y; y = z; } return z; } int main() { scanf("%d",&t); while (t--){ int max1,max2; scanf("%d",&n); for (int i=0;i=0;i--){ if (a[i]==0&&b[i]==0) continue; else { if (a[i]==0){ printf("0/1\n"); break; }else if (b[i]==0){ printf("1/0\n"); break; }else{ x=measure(a[i],b[i]); printf("%d/%d\n",a[i]/x,b[i]/x); break; } } } } return 0; }