/* * =template=.cpp * Copyright (C) 2017 hzw * * Distributed under terms of the MIT license. */ #include #include #include #include #include #include #include #include #include #include #include #include #define FR first #define SC second #define MP make_pair #define rep(i,a,b) for (int i=a;i<=b;i++) #define pb push_back #define ws wss #define left lll #define right rrr using namespace std; typedef long long LL; typedef pair PII; template void upmax(T &a,T b) { if (a void upmin(T &a,T b) { if (a>b) a=b;} void read(int &x) { char ch;int fu=1; while ((ch=getchar())<=32); x=0; if (ch=='-') fu=-1;else x=ch-48; while ((ch=getchar())>32) x=x*10+ch-48; x*=fu; } void read(unsigned long long &x) { char ch;int fu=1; while ((ch=getchar())<=32); x=0; if (ch=='-') fu=-1;else x=ch-48; while ((ch=getchar())>32) x=x*10+ch-48; x*=fu; } const double pi=acos(-1); void upmax(int &a,int b) { if (ab) a=b;} //----------------------- int exp(int a,int b,int c) { int d=1; while (b) { if (b&1) d=1LL*d*a%c; b>>=1;a=1LL*a*a%c; } return d; } int gcd(int a,int b) { return b>0?gcd(b,a%b):a;} const int N=110000,p=1000000007; int cas,n; int f[N],g[N]; int main() { scanf("%d",&cas); while (cas--) { scanf("%d",&n); for (int i=0;i=0;i--) if (f[i]!=0) {a=i;break;} for (int i=n-1;i>=0;i--) if (g[i]!=0) {b=i;break;} if (a>b) puts("1/0"); else if (a