Read problems statements in Mandarin Chinese  and Russian. 

Alice and Bob, both have to drink water. But they both don't want to go, so they will play a game to decide who will fetch water for both of them. Alice will choose a number randomly between 1 and N (both inclusive) and Bob will choose a number randomly between 1 and M (both inclusive). Both will write their numbers on a slip of paper. If sum of numbers choosen by both is odd, then Alice will go, else Bob will go.

What is probability that Alice will go?

------ Input ------ 

First line contains, T, the number of testcases. Each testcase consists of N and M in one line, separated by a space.

------ Output ------ 

For each test case, output a single line containing probability as an irreducible fraction.

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤ N,M ≤ 10^{9}$

----- Sample Input 1 ------ 
3
1 1
1 2
2 3
----- Sample Output 1 ------ 
0/1
1/2
1/2
----- explanation 1 ------ 
#test1: The only way is when Alice and Bob both choose 1. So, Alice won't have to go because sum is even.
#test2: The different ways are (1,1) and (1,2), where first term denotes the number choosen by Alice. So of all possible cases (ie. 2) in only 1 case Alice has to go. Therefore, probability is 1/2.
#test3: The different ways are (1,1), (1,2), (1,3), (2,1), (2,2), (2,3) where first term denotes the number choosen by Alice. So of all possible cases (ie. 6) in only 3 cases Alice has to go. Therefore, probability is 1/2.

Difficulty: MEDIUM
Tags: Combinatorics

Ad-hoc

Starter code:

Solutions:
from fractions import Fraction

def f(a, b):
	if b == 0:
		return a
	return f(b, a % b)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	p = n * m
	t = f(p, p // 2)
	print('0/' + str(p // t) if p // (2 * t) == 0 else Fraction(p // (2 * t), p // t))


from math import gcd
for _ in range(int(input())):
	NM = input().split()
	N = int(NM[0])
	M = int(NM[1])
	a = int((N + 1) // 2 * (M // 2))
	a += int((M + 1) // 2 * (N // 2))
	b = N * M
	if a != 0:
		c = gcd(a, b)
		a = a // c
		b = b // c
	print(a, '/', b, sep='')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	d = a * b
	if d % 2 == 0:
		print('1/2')
	else:
		print(f'{d // 2}/{d}')


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	ao = 0
	ae = 0
	ae = a // 2
	ao = a - ae
	be = b // 2
	bo = b - be
	pr = a * b
	pl = bo * ae
	pl += be * ao
	t = math.gcd(pl, pr)
	print(f'{pl // t}/{pr // t}')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	p = n * m
	print('1/2' if p % 2 == 0 else str(p // 2) + '/' + str(p))


import math
for _ in range(int(input())):
	(m, n) = map(int, input().split())
	em = math.ceil(m // 2)
	om = m - em
	en = math.ceil(n // 2)
	on = n - en
	total = m * n
	req = om * en + em * on
	g = math.gcd(total, req)
	print(str(req // g) + '/' + str(total // g))


from math import gcd
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	(even_n, odd_n) = (n // 2, n - n // 2)
	(even_m, odd_m) = (m // 2, m - m // 2)
	num = even_m * odd_n + even_n * odd_m
	den = n * m
	g = gcd(num, den)
	print(num // g, '/', den // g, sep='')


import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if n % 2 == 0:
		oddn = n // 2
		evenn = n - oddn
	else:
		oddn = n // 2 + 1
		evenn = n - oddn
	if m % 2 == 0:
		oddm = m // 2
		evenm = m - oddm
	else:
		oddm = m // 2 + 1
		evenm = m - oddm
	gcd = math.gcd(oddn * evenm + evenn * oddm, n * m)
	numerator = (oddn * evenm + evenn * oddm) // gcd
	denomenator = n * m // gcd
	s = ''
	s += str(numerator)
	s += '/'
	s += str(denomenator)
	print(s)


def cmmdc(a, b):
	if a == 0 or b == 0:
		return 1
	while a != 0:
		r = b % a
		b = a
		a = r
	return b
T = int(input())
for _ in range(T):
	(n, m) = map(int, input().split())
	even = n // 2 * (m // 2) + (n - n // 2) * (m - m // 2)
	odd = n * m - even
	total = n * m
	r = cmmdc(total, odd)
	total //= r
	odd //= r
	print(str(odd) + '/' + str(total))


import math
from fractions import Fraction
t = int(input())
while t:
	(n, m) = map(int, input().split(' '))
	if n == 1 and m == 1:
		print('0/1')
	else:
		p = math.ceil(n / 2)
		q = math.ceil(m / 2)
		r = math.floor(n / 2)
		s = math.floor(m / 2)
		print(Fraction(p * s + q * r, n * m))
	t = t - 1


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	k = a * b
	if k == 1:
		print('0/1')
	elif k % 2 == 0:
		print('1/2')
	else:
		print('{}/{}'.format(k // 2, k))


from fractions import Fraction

def lcm(i, j):
	if i > j:
		greater = i
	else:
		greater = j
	while True:
		if greater % i == 0 and greater % j == 0:
			lcm = greater
			break
		greater += 1
	return lcm
vojj = int(input())
for vishnesh in range(vojj):
	(n, m) = map(int, input().split())
	s = 0
	p = 0
	if n % 2:
		a = n // 2 + 1
		b = n
	else:
		a = n // 2
		b = n
	c = m // 2
	d = m
	pu1 = a * c
	pd1 = b * d
	a = n // 2
	b = n
	if m % 2:
		c = m // 2 + 1
		d = m
	else:
		c = m // 2
		d = m
	pu2 = a * c
	pd2 = b * d
	dwn = lcm(pd1, pd2)
	q = pu1 * (dwn // pd1)
	r = pu2 * (dwn // pd2)
	m = q + r
	if m == 0:
		print('0/1')
	else:
		print(Fraction(m, dwn))


def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
t = int(input())
while t > 0:
	(n, m) = map(int, input().strip().split())
	x = n * m
	y = n * m // 2
	z = gcd(x, y)
	print('{}/{}'.format(y // z, x // z))
	t -= 1


v = int(input())
for c in range(v):
	(k, m) = map(int, input().split(' '))
	print('1/2' if k * m % 2 == 0 else str(k * m // 2) + '/' + str(k * m))


from fractions import Fraction

def no_odd_even(n):
	odd = n // 2 + n % 2
	return (odd, n - odd)
t = int(input())
for _ in range(t):
	(n, m) = list(map(int, input().split()))
	(o1, e1) = no_odd_even(n)
	(o2, e2) = no_odd_even(m)
	f = Fraction(o1 * e2 + o2 * e1, n * m)
	print(f if f else '0/1')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	p = x * y
	if p % 2 == 0:
		print('1/2')
	else:
		print(str(p // 2) + '/' + str(p))


import math as m
import fractions as f
for i in range(int(input())):
	(a, b) = map(int, input().split())
	ao = m.ceil(a / 2)
	bo = m.ceil(b / 2)
	ae = a - ao
	be = b - bo
	if ao * be + bo * ae == 0:
		print(str(ao * be + bo * ae) + '/' + str(a * b))
	else:
		print(f.Fraction(ao * be + bo * ae, a * b))


import math
tc = int(input())
for _ in range(tc):
	(n, m) = [int(x) for x in input().split(' ')]
	n_even = n // 2
	n_odd = n - n_even
	m_even = m // 2
	m_odd = m - m_even
	numerator = n_odd * m_even + n_even * m_odd
	denominator = m * n
	gcd = math.gcd(numerator, denominator)
	numerator = numerator // gcd
	denominator = denominator // gcd
	print(f'{numerator}/{denominator}')


import math
t = int(input())
for t in range(t):
	(n, m) = [int(i) for i in input().split()]
	if n % 2 == 0:
		n_even = n // 2
		n_odd = n // 2
	else:
		n_even = n // 2
		n_odd = n_even + 1
	if m % 2 == 0:
		m_even = m // 2
		m_odd = m // 2
	else:
		m_even = m // 2
		m_odd = m_even + 1
	sum_odd = n_even * m_odd + n_odd * m_even
	dn = n * m
	j = math.gcd(dn, sum_odd)
	print(f'{sum_odd // j}/{dn // j}')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	k = n * m
	if k == 1:
		print('0/1')
	elif k % 2 == 0:
		print('1/2')
	else:
		print('{}/{}'.format(k // 2, k))


for i in range(int(input())):
	(alice, bob) = map(int, input().split())
	if alice * bob % 2 == 0:
		print('1/2')
	else:
		print(str(alice * bob // 2) + '/' + str(alice * bob))


import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	even1 = n // 2
	if n == 0:
		even1 = 1
	even2 = m // 2
	if m == 0:
		even2 = 1
	odd1 = (n + 1) // 2
	odd2 = (m + 1) // 2
	a1 = odd1 * even2 + even1 * odd2
	a2 = n * m
	gcde = math.gcd(a1, a2)
	print(a1 // gcde, '/', n * m // gcde, sep='')


from fractions import Fraction

def gd(a, b):
	if b == 0:
		return a
	return gd(b, a % b)
t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	dn = n * m
	nn = dn // 2
	g = gd(dn, nn)
	dn = dn // g
	nn = nn // g
	if nn == 0:
		print('0' + '/' + str(dn))
	else:
		print(Fraction(nn, dn))
	t -= 1


for i in range(int(input())):
	(n, m) = map(int, input().split())
	s = n * m
	if s % 2 == 0:
		print('1/2')
	else:
		print(str(s // 2) + '/' + str(m * n))


for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	total = a * b
	if total % 2 == 0:
		print('1/2')
	else:
		print(str(total // 2) + '/' + str(total))


from fractions import Fraction

def gd(a, b):
	if b == 0:
		return a
	return gd(b, a % b)
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	dn = n * m
	nn = dn // 2
	g = gd(dn, nn)
	dn = dn // g
	nn = nn // g
	if nn == 0:
		print('0' + '/' + str(dn))
	else:
		print(Fraction(nn, dn))


from fractions import Fraction

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	den = n * m
	num = den // 2
	g = gcd(den, num)
	den = den // g
	num = num // g
	if num == 0:
		print('0' + '/' + str(den))
	else:
		print(Fraction(num, den))
	t -= 1


def gcd(a, b):
	if a % b == 0:
		return b
	return gcd(b, a % b)
for i in range(int(input())):
	(N, M) = map(int, input().split())
	denominator = N * M
	if N == 1 and M == 1:
		print('0/1')
	else:
		numerator = denominator // 2
		hcf = gcd(numerator, denominator)
		numerator //= hcf
		denominator //= hcf
		a = str(numerator)
		b = str(denominator)
		print(a + '/' + b)


for _ in range(int(input())):
	from math import gcd
	(n, m) = map(int, input().split())
	e1 = n // 2
	o1 = n - e1
	e2 = m // 2
	o2 = m - e2
	total = n * m
	pos_cases = e1 * o2 + o1 * e2
	g = gcd(pos_cases, total)
	if g == 1:
		print(f'{pos_cases}/{total}')
	else:
		print(f'{pos_cases // g}/{total // g}')


from math import gcd

def evenodds(n):
	if n % 2 == 0:
		return [n // 2, n // 2]
	else:
		return [n // 2, n // 2 + 1]

def reduceFraction(x, y):
	d = gcd(x, y)
	x = x // d
	y = y // d
	return [x, y]
t = int(input())
for _ in range(t):
	(m, n) = tuple(map(int, input().split()))
	l1 = evenodds(m)
	l2 = evenodds(n)
	nume = l1[0] * l2[1] + l1[1] * l2[0]
	deno = m * n
	ans = reduceFraction(nume, deno)
	print(str(ans[0]) + '/' + str(ans[1]))


from fractions import Fraction

def hcf(x, y):
	a = min(x, y)
	hcf = 0
	for i in range(1, a + 1):
		if x % i == 0 and y % i == 0:
			hcf = i
			return hcf
	return x
T = int(input())
for i in range(T):
	(N, M) = map(int, input().split())
	if N == 1 and M == 1:
		print('0/1')
	else:
		Total = N * M
		Odd = Total // 2
		fac = hcf(Total, Odd)
		Total = Total // fac
		Odd = Odd // fac
		print(Fraction(Odd, Total))


for tc in range(int(input())):
	(a, b) = map(int, input().split())
	if a % 2 == 1 and b % 2 == 1:
		(am, an) = (a // 2 + 1, a // 2)
		(bm, bn) = (b // 2 + 1, b // 2)
		num = am * bn + bm * an
		den = a * b
		print(str(num) + '/' + str(den))
	else:
		print('1/2')


T = int(input())
for I in range(T):
	x = 1
	y = 1
	(n, m) = map(int, input().split())
	if n == 1 and m == 1:
		x = 0
		y = 1
	elif n % 2 == 0 or m % 2 == 0:
		x = 1
		y = 2
	else:
		x = int(n * m // 2)
		y = int(n * m)
	print(f'{x}/{y}')


for I in range(int(input())):
	(n, m) = map(int, input().split())
	a = n * m
	if a == '1':
		print('0/1')
	elif a % 2 == 0:
		print('1/2')
	else:
		print('{}/{}'.format(a // 2, a))


from fractions import Fraction
import math
for i in range(int(input())):
	(n, m) = map(int, input().split())
	tnpoc = n * m
	poc = tnpoc // 2
	gcd = math.gcd(tnpoc, poc)
	tnpoc //= gcd
	poc //= gcd
	if poc == 0:
		print('0' + '/' + str(tnpoc))
	else:
		print(Fraction(poc, tnpoc))


from fractions import Fraction
import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	den = n * m
	num = den // 2
	gcd = math.gcd(den, num)
	den = den // gcd
	num = num // gcd
	if num == 0:
		print('0/' + str(den))
	else:
		print(Fraction(num, den))


def gd(n1, n2):
	if n2 != 0:
		return gd(n2, n1 % n2)
	else:
		return n1
for _ in range(int(input())):
	c = list(map(int, input().split()))
	n_even = []
	n_odd = []
	for i in range(2):
		n_even.append(c[i] // 2)
		if c[i] % 2:
			n_odd.append((c[i] + 1) // 2)
		else:
			n_odd.append(c[i] // 2)
	num = n_even[0] * n_odd[1] + n_even[1] * n_odd[0]
	den = c[0] * c[1]
	d = gd(num, den)
	print(num // d, '/', den // d, sep='')


from fractions import Fraction
for i in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	if n % 2 == 0 and m % 2 == 0:
		print('1/2')
	elif n == 1 and m == 1:
		print('0/1')
	elif n % 2 != 0 and m % 2 != 0:
		if n > m:
			maxi = n
			mini = m
		else:
			maxi = m
			mini = n
		k = maxi // 2
		l = mini // 2
		s = (k + 1) * l + k * (mini - l)
		print(f'{s}/{n * m}')
	else:
		if n > m:
			maxi = n
			mini = m
		else:
			maxi = m
			mini = n
		if mini % 2 != 0 and maxi % 2 == 0:
			s = mini * (maxi // 2) / (n * m)
			print(Fraction(s))
		else:
			k = maxi // 2
			l = mini // 2
			s = ((k + 1) * l + k * (mini - l)) / (n * m)
			print(Fraction(s))


t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	if n == 1 and m == 1:
		print('{}/{}'.format(0, 1))
		t = t - 1
		continue
	if n % 2 == 0 or m % 2 == 0:
		print('{}/{}'.format(1, 2))
	else:
		print('{}/{}'.format(n * m // 2, n * m))
	t = t - 1


n = int(input())
for _ in range(n):
	(alice, bob) = list(map(int, input().split()))
	total_ways = alice * bob
	if total_ways % 2 == 0:
		print('1/2')
	else:
		print(str(total_ways // 2) + '/' + str(total_ways))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a * b % 2 != 0:
		print(f'{a * b // 2}/{a * b}')
	else:
		print('1/2')


from fractions import Fraction
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	ev1 = a // 2
	odd1 = a - ev1
	ev2 = b // 2
	odd2 = b - ev2
	res = odd1 * ev2 + ev1 * odd2
	if res != 0:
		print(Fraction(res, a * b))
	else:
		print('0/{}'.format(a * b))


from math import gcd

def solve():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		parity_odd = n // 2 * ((m + 1) // 2) + (n + 1) // 2 * (m // 2)
		simplifier = gcd(parity_odd, n * m)
		(numerator, denominator) = (parity_odd // simplifier, n * m // simplifier)
		print('{}/{}'.format(numerator, denominator))
solve()


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	y = n * m
	if n % 2 == 0 and m % 2 == 0:
		x = 1
		y = 2
	elif n % 2 and m % 2 == 0:
		x = (n // 2 + 1) * (m // 2) + n // 2 * (m // 2)
	elif n % 2 == 0 and m % 2:
		x = n // 2 * (m // 2 + 1) + n // 2 * (m // 2)
	else:
		x = (n // 2 + 1) * (m // 2) + n // 2 * (m // 2 + 1)
	g = gcd(x, y)
	x //= g
	y //= g
	print(x, y, sep='/')


from math import gcd
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	odds_1 = n // 2 + n % 2
	evens_1 = n // 2
	odds_2 = m // 2 + m % 2
	evens_2 = m // 2
	s = odds_1 * evens_2 + odds_2 * evens_1
	p = n * m
	g = gcd(s, p)
	print(f'{s // g}/{n * m // g}')


from fractions import Fraction
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	(x1, y1, x2, y2) = (0, 0, 0, 0)
	if n % 2 == 0:
		x1 = n // 2
		y1 = n // 2
	else:
		x1 = (n - 1) // 2
		y1 = (n - 1) // 2 + 1
	if m % 2 == 0:
		x2 = m // 2
		y2 = m // 2
	else:
		x2 = (m - 1) // 2
		y2 = (m - 1) // 2 + 1
	odd = 0
	even = 0
	even = x2 * x1 + y1 * y2
	odd = x2 * y1 + y2 * x1
	frac = Fraction(odd, odd + even)
	print('{0}/{1}'.format(frac.numerator, frac.denominator))


def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)
T = int(input())
for i in range(T):
	(N, M) = map(int, input().split())
	AO = N // 2 + N % 2
	AE = N // 2
	BO = M // 2 + M % 2
	BE = M // 2
	PNUM = AO * BE + AE * BO
	PDEN = M * N
	if M % 2 == 0 or N % 2 == 0:
		print('1/2')
	else:
		gcd = GCD(PNUM, PDEN)
		PNUM = PNUM // gcd
		PDEN = PDEN // gcd
		print(str(PNUM) + '/' + str(PDEN))


T = int(input())
for i in range(0, T):
	temp = input().split()
	N = int(temp[0])
	M = int(temp[1])
	Aeven = 0
	Aodd = 0
	Beven = 0
	Bodd = 0
	var = 0
	var2 = 0
	var3 = 0
	var4 = 0
	if N % 2 == 0:
		Aodd = N // 2
		Aeven = N // 2
	else:
		Aodd = (N - 1) // 2 + 1
		Aeven = (N - 1) // 2
	if M % 2 == 0:
		Bodd = M // 2
		Beven = M // 2
	else:
		Bodd = (M - 1) // 2 + 1
		Beven = (M - 1) // 2
	var = Aeven * Bodd
	var2 = Beven * Aodd
	var3 = N * M
	var4 = int(var2 + var)
	if var4 == 0:
		print('{}/{}'.format(0, 1))
		continue
	x = var3
	y = var4
	r = x % y
	while r != 0:
		x = y
		y = r
		r = x % y
	var3 = var3 // y
	var4 = var4 // y
	print('{}/{}'.format(var4, var3))


t = int(input())
import math
for i in range(t):
	(n, m) = map(int, input().split())
	(even1, even2) = (n // 2, m // 2)
	(odd1, odd2) = (n - even1, m - even2)
	p = (even1 * odd2 + odd1 * even2) // math.gcd(even1 * odd2 + odd1 * even2, m * n)
	print(f'{p}/{m * n // math.gcd(even1 * odd2 + odd1 * even2, m * n)}')


import math

def getodd(n):
	if n % 2 == 0:
		return n // 2
	else:
		return (n + 1) // 2

def getgcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
T = int(input())
for i in range(T):
	inp = [int(i) for i in input().split(' ')]
	xodd = getodd(inp[0])
	yodd = getodd(inp[1])
	if inp[0] == inp[1] and (inp[1] == 1 or inp[1] == 0):
		print('0/1')
	else:
		topval = xodd * (inp[1] - yodd) + (inp[0] - xodd) * yodd
		botom = inp[0] * inp[1]
		gcd = math.gcd(topval, botom)
		topval = topval // gcd
		botom = botom // gcd
		print(topval, '/', botom, sep='')


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	nOdd = math.ceil(n / 2)
	mOdd = math.ceil(m / 2)
	nEven = n - nOdd
	mEven = m - mOdd
	nm = nOdd * mEven + nEven * mOdd
	dm = n * m
	k = gcd(nm, dm)
	nm = nm // k
	dm = dm // k
	print(f'{nm}/{dm}')


from fractions import Fraction

def quantity(num):
	if num % 2 == 1:
		countodd = (num + 1) // 2
		counteve = (num - 1) // 2
	elif num % 2 == 0:
		countodd = num // 2
		counteve = num // 2
	return (counteve, countodd)

def gcd1(m, n):
	if m < n:
		(m, n) = (n, m)
	if m % n == 0:
		return n
	else:
		return gcd1(n, m % n)
for t in range(int(input())):
	(N, M) = map(int, input().split())
	(oddN, evenN) = quantity(N)
	(oddM, evenM) = quantity(M)
	total_sample = (oddN + evenN) * (oddM + evenM)
	alice = oddN * evenM + oddM * evenN
	if alice == 0:
		print('0/' + str(total_sample))
	else:
		print(Fraction(alice, total_sample))


t = int(input())
for i in range(t):
	(n, m) = list(map(int, input().split()))
	c = n * m
	if c % 2 == 0:
		print('1/2')
	else:
		print(str(c // 2) + '/' + str(c))


from math import sqrt, ceil, floor, gcd, log2
import sys
from sys import stdin, stdout
from collections import Counter, defaultdict, OrderedDict, deque
from itertools import combinations, groupby
from time import time
from heapq import heappop, heappush, heapify
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n % 2 and m % 2:
		ans = (n * m - 1) // 2
		ans = str(ans)
		print(ans + '/' + str(n * m))
	else:
		print(str('1') + '/' + str('2'))


t = int(input())
for x in range(t):
	a = [int(c) for c in input().split()]
	total_ways = a[0] * a[1]
	if total_ways % 2 == 0:
		print('1/2')
	else:
		print(f'{total_ways // 2}/{total_ways}')


num = int(input())
while num:
	o = input().partition(' ')
	m = int(o[0])
	n = int(o[2])
	if m % 2 and n % 2:
		print(str((m * n - 1) // 2) + '/' + str(m * n))
	else:
		print('1/2')
	num -= 1


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	t = a * b
	if t % 2 == 0:
		print('1/2')
	else:
		print(str(t // 2) + '/' + str(t))


from fractions import Fraction
import math
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	even1 = 0
	even2 = 0
	odd1 = 0
	odd2 = 0
	count = 0
	total = a * b
	if a % 2 == 0:
		even1 = odd1 = a // 2
	elif a % 2 == 1:
		even1 = a // 2
		odd1 = even1 + 1
	if b % 2 == 0:
		even2 = b // 2
		odd2 = b - even2
	elif b % 2 == 1:
		even2 = b // 2
		odd2 = 1 + even2
	count = even1 * odd2 + even2 * odd1
	x = math.gcd(count, total)
	print(f'{count // x}/{total // x}')


import math
cases = int(input())
for i in range(cases):
	(m, n) = [int(x) for x in input().split()]
	a = (m + 1) // 2
	b = (n + 1) // 2
	odd = a * (n - b) + (m - a) * b
	gcdiv = math.gcd(m * n, odd)
	print(f'{odd // gcdiv}/{m * n // gcdiv}')


t = int(input())
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	e1 = n // 2
	o1 = e1 + n % 2
	e2 = m // 2
	o2 = e2 + m % 2
	nu = e1 * o2 + e2 * o1
	de = n * m
	if n % 2 == 0 or m % 2 == 0:
		nu = 1
		de = 2
	s = ''
	s += str(nu) + '/' + str(de)
	print(s)


T = int(input())
for i in range(0, T):
	(N, M) = map(int, input().split())
	total = N * M
	if total % 2 == 0:
		print('1/2')
	else:
		print(str(total // 2) + '/' + str(total))


def hcfnaive(a, b):
	if b == 0:
		return abs(a)
	else:
		return hcfnaive(b, a % b)
t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	(k1, k2) = (0, 0)
	if l[0] % 2 == 1:
		k1 = 1
	if l[1] % 2 == 1:
		k2 = 1
	c = l[0] // 2 * (l[1] // 2 + k2) + (l[0] // 2 + k1) * (l[1] // 2)
	if l[0] == 1 and l[1] == 1:
		c = 0
	k = l[0] * l[1]
	if c != 0:
		p = hcfnaive(k, c)
		k = k // p
		c = c // p
	s = str(c) + '/' + str(k)
	print(s)


from math import gcd
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	(ea, eb) = (a // 2, b // 2)
	(oa, ob) = (a - ea, b - eb)
	g = ea * ob + oa * eb
	t = a * b
	if g:
		d = gcd(g, t)
		print(f'{g // d}/{t // d}')
	else:
		print('0/1')