Read problem statements in [Mandarin], [Vietnamese], and [Russian] as well.

Alice and Bob play the classic game of odds and evens. In this game, each of the two players choose a number between 1 and 5 without revealing to their opponent. Both of the players then simultaneously reveal their number by holding up that many fingers of their hand. Then the winner is decided based upon whether the sum of numbers played by both the players is odd or even. In this game we assume that if the sum is odd then Alice wins, otherwise Bob wins.

If Alice held up a fingers and Bob held up b fingers, determine who won the game.

------ Input Format ------ 

- First line will contain T, number of testcases. Then the T testcases follow.
- Each testcase contains of a single line of input, two integers a, b which denote the number played by Alice and Bob respectively.

------ Output Format ------ 

For each testcase, output which player won the game.

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

$1 ≤ T ≤ 1000$
$1 ≤ a, b ≤ 5$

----- Sample Input 1 ------ 
2
1 1
1 2

----- Sample Output 1 ------ 
Bob
Alice

----- explanation 1 ------ 
In the first test case, Alice and Bob both played $1$. The sum of the numbers played by them is $2$ which is even. Therefore Bob wins.

In the second test case, Alice played $1$ while Bob played $2$. The sum of the numbers played by them is $3$ which is odd. Therefore Alice wins.

Source: codechef | Difficulty: EASY
Tags: Mathematics

Number theory

Implementation


Solutions:
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


T = int(input())
for i in range(T):
	(x, y) = map(int, input().split())
	if (x + y) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	res = n + m
	if res % 2 == 0:
		print('Bob')
	else:
		print('Alice')


for item in range(int(input())):
	(a, b) = map(int, input().split())
	if 1 <= (a and b) <= 5:
		convert = a + b
		if convert % 2 == 0:
			print('Bob')
		else:
			print('Alice')


for i in range(int(input())):
	(a1, b1) = map(int, input().split())
	if (a1 + b1) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	if x <= 5 and x >= 1 and (y >= 1) and (y <= 5):
		if (x + y) % 2 == 0:
			print('Bob')
		else:
			print('Alice')


t = int(input())
for i in range(t):
	nums = str(input()).split()
	nums[0] = int(nums[0])
	nums[1] = int(nums[1])
	if sum(nums) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


a = int(input(''))
for t in range(0, a):
	(x, y) = map(int, input('').split())
	if (x + y) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	if sum(l) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


t = int(input())
while t:
	t -= 1
	(a, b) = map(int, input().split())
	c = a + b
	if c % 2 == 0:
		print('Bob')
	else:
		print('Alice')


T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	if a % 2 == 0 and b % 2 == 0:
		print('Bob')
	elif a % 2 != 0 and b % 2 != 0:
		print('Bob')
	elif a % 2 == 0 and b % 2 != 0:
		print('Alice')
	elif a % 2 != 0 and b % 2 == 0:
		print('Alice')


def OnE(x, y):
	ans = x + y
	if ans % 2 == 0:
		print('Bob')
	else:
		print('Alice')
t = int(input())
for i in range(0, t):
	(a, b) = map(int, input().split())
	c = OnE(a, b)


def code():
	cases = int(input())
	for _ in range(cases):
		(a, b) = map(int, input().split(' '))
		total_fingering = a + b
		if total_fingering % 2 == 0:
			print('Bob')
		if total_fingering % 2 != 0:
			print('Alice')
code()


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


t = int(input())
for _ in range(t):
	(x, y) = list(map(int, input().split()))
	s = x + y
	if s % 2 == 1:
		print('Alice')
	else:
		print('Bob')


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	z = x + y
	if z % 2 == 1:
		print('Alice')
	else:
		print('Bob')


t = int(input())
for i in range(0, t):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	if (a + b) % 2 == 0:
		print('Bob')
	else:
		print('Alice')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Bob')
	elif (a + b) % 2 != 0:
		print('Alice')


for _ in range(int(input())):
	a = sum(list(map(int, input().split())))
	print('Bob' if a % 2 == 0 else 'Alice')