from fractions import Fraction


def guessing_game(m, n):
    if m == 1 and n == 1: print "0/1"
    elif m%2 != 0 and n%2 != 0:
        denom = (4 * m * n)
        a = (m + 1) * (n - 1)
        b = (m - 1) * (n + 1)
        k = a + b
        t = Fraction(k, denom)
        print str(t.numerator) + "/" + str(t.denominator)
    else: print "1/2"

t = int(raw_input())
for i in range(t):
	inp = raw_input().split()
	n, m = int(inp[0]), int(inp[1])
	guessing_game(m, n)