import fractions as fs
N = input()
A = []
for i in range(N):
	t = raw_input().split()
	t2=[]
	t2.append(int(t[0]))
	t2.append(int(t[1]))
	A.append(t2)
	
def getOdd(n,m):
	if (n*m)&1 :
		return n*m/2
	else:
		return ((n*m-1)/2)+1
		
def solve(x):
	n = x[0]
	m = x[1]
	odd = getOdd(n,m)
	tot = n*m
	c = fs.gcd(odd,tot)
	a = odd/c
	b = tot/c
	print str(a)+'/'+str(b)
	
for x in A:
	solve(x)