import sys

def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

t = input()
for _ in xrange(t):
	n,m = map(int, sys.stdin.readline().split())
	if n%2==1 and m%2==1:
		p = m*n-1
		q = 2*m*n
		g = gcd(p,q)
		print str(p/g)+'/'+str(q/g)
	else:
		print '1/2'