from fractions import gcd
T = int(raw_input())
while T>0:
  case = raw_input()
  nos = case.split()
  N = int(nos[0])
  M = int(nos[1])
  sample_space = M*N
  if N%2==0 and M%2==0:
    alice_goes_probability = 1/2
    num = (N/2)*M
  elif N%2==0:
    alice_goes_probability = ((N/2)*(M/2 + 1) + (N/2)*(M/2))   /  M*N
    num = (N/2)*(M/2 + 1) + (N/2)*(M/2)
  elif M%2==0:
    alice_goes_probability = ((M/2)*(N/2 + 1) + (N/2)*(M/2))   /  M*N
    num = (M/2)*(N/2 + 1) + (N/2)*(M/2)
  else:
    alice_goes_probability = (((N-1)/2)*((M+1)/2) + ((N+1)/2)*((M-1)/2))  / M*N
    num = ((N-1)/2)*((M+1)/2) + ((N+1)/2)*((M-1)/2)
  common_factor = gcd(sample_space, num)
  print str(num/common_factor)+'/'+str(sample_space/common_factor)
  T = T - 1
exit()