#include #include #include #include #include #include #include #include #include using namespace std; char ch[200010]; map q; int gcd( int x , int y ) { if( y == 0 ) return x; else return gcd( y , x%y ); } unsigned int BKDRHash(char *str) { unsigned int seed = 131; // 31 131 1313 13131 131313 etc.. unsigned int hash = 0; while (*str) { hash = hash * seed + (*str++); } return (hash & 0x7FFFFFFF); } int main() { int n , m; while( scanf( "%d" , &n ) != EOF ) { while( n-- ) { int x = 0 , y = 0 , ad = 0; q.clear(); scanf( "%d" , &m ); for( int i=0 ; i 1 ) ad += mk * (mk-1) / 2 - (mk-1) * (mk-2) / 2; q[k] = mk; } int a = x * y + ad , b = m * ( m-1 ) / 2; int z = gcd( a , b ); printf( "%d/%d\n" , a / z , b / z ); } } return 0; }