AtCoder Beginner Contest 109 - ABC333

You are given integers A and B, each between 1 and 3 (inclusive).
Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq A, B \leq 3

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
If there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.

-----Sample Input-----
3 1

-----Sample Output-----
Yes

Let C = 3. Then, A \times B \times C = 3 \times 1 \times 3 = 9, which is an odd number.

Difficulty: EASY

Starter code:

Solutions:
(A, B) = map(int, input().split())
flg = True
for i in range(1, 4):
	if A * B * i % 2 == 1:
		flg = False
if flg == False:
	print('Yes')
elif flg == True:
	print('No')


(a, b) = map(int, input().split())
if a * b % 2 == 0:
	print('No')
else:
	print('Yes')


print('No' if '2' in input().split() else 'Yes')


print('No' if '2' in input().replace(' ', '') else 'Yes')


print('Yes' if '2' not in input() else 'No')


(a, b) = map(int, input().split())
print('NYoe s'[a * b % 2::2])


(A, B) = map(int, input().split())
print('Yes' * (A % 2 == B % 2 == 1) or 'No')


print('Yes' if eval(input().replace(' ', '*') + '%2==1') else 'No')


(A, B) = map(int, input().split())
print('YNeos'[not (A % 2 and B % 2)::2])


(A, B) = map(int, input().split())
if A * B % 2 == 1:
	print('Yes')
else:
	print('No')


(A, B) = map(int, input().split())
for i in range(1, 4):
	if A * B * i % 2 == 1:
		print('Yes')
		break
else:
	print('No')


(A, B) = list(map(int, input().split()))
if A * B % 2 == 0:
	print('No')
else:
	print('Yes')
pass


(x, y) = [int(_) for _ in input().split()]
if x * y % 2 == 0:
	print('No')
else:
	print('Yes')


(A, B) = map(int, input().split())
print('YNeos'[A % 2 * (B % 2) == 0::2])


print('YNeos'['2' in input()::2])


a = input()
print(['Yes', 'No']['2' in a])


print('No' if 2 in [int(x) for x in input().split()] else 'Yes')


if input().count('2') > 0:
	print('No')
else:
	print('Yes')


(a, b) = map(int, input().split())
print('YNeos'[a * b % 2 == 0::2])


(a, b) = map(int, input().split())
print('Yes' if a % 2 == 1 and b % 2 == 1 else 'No')


print('No' if eval(input().replace(' ', '*')) % 2 == 0 else 'Yes')


lst = input().split()
A = int(lst[0])
B = int(lst[1])
if A * B % 2 == 1:
	print('Yes')
else:
	print('No')


(a, b) = map(int, input().split())
print('YNeos'[a * b % 2 < 1::2])


(n, m) = [int(x) for x in input().split()]
if n == 2 or m == 2:
	print('No')
else:
	print('Yes')


(N, Y) = [int(i) for i in input().split()]
print('Yes' if N * Y % 2 == 1 else 'No')


print('NYoe s'[eval(input().replace(' ', '*')) % 2::2])


(a, b) = map(int, input().split())
print(['Yes', 'No'][a * b % 2 < 1])


(a, b) = map(int, input().split())
print('YNeos'[a * b % 2 != 1 and 3 * a * b % 2 != 1::2])


AB = input()
print('No' if '2' in AB else 'Yes')


(A, B) = map(int, input().split())
print(['No', 'Yes'][A % 2 == 1 and B % 2 == 1])


(A, B) = map(int, input().split())
print('NYoe s'[A % 2 and B % 2::2])


print(['No', 'Yes'][eval(input().replace(' ', '*')) % 2])


(A, B) = map(int, input().split())
if A % 2 == 0 or B % 2 == 0:
	print('No')
else:
	print('Yes')


(a, b) = map(int, input().split())
print(('No', 'Yes')[a * b % 2 != 0])


a = input().split()
if int(a[0]) * int(a[1]) % 2 == 1:
	print('Yes')
else:
	print('No')


(a, b) = map(int, input().split())
cnt = 0
for i in range(1, 4):
	if a * b * i % 2 == 1:
		cnt += 1
print('Yes' if cnt > 0 else 'No')


(a, b) = [int(x) for x in input().split()]
print('Yes' if a * b % 2 == 1 else 'No')


(n, k) = map(int, input().split())
print('Yes' if n & 1 and k & 1 else 'No')


print('Yes' if all([int(s) % 2 for s in input().split()]) else 'No')


s = input().split()
i = s.count('2')
print('No') if i > 0 else print('Yes')


(a, b) = map(int, input().split())
z = 'No'
for i in range(1, 4):
	if a * b * i % 2 == 1:
		z = 'Yes'
print(z)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(a, b) = Input()
	if a * b % 2 == 0:
		print('No')
	else:
		print('Yes')
main()


(A, B) = map(int, input().split())
ans = 'No'
for C in range(1, 4):
	if A * B * C % 2 != 0:
		ans = 'Yes'
		break
print(ans)


nums = input()
if '2' in nums:
	print('No')
else:
	print('Yes')


(a, b) = map(int, input().split())
for c in range(1, 3):
	if a * b * c % 2 == 1:
		print('Yes')
		return
print('No')


print(['No', 'No', 'Yes'][sum([n % 2 for n in map(int, input().split())])])


print('YNeos'[input().count('2') > 0::2])


print('YNeos'['2' in input().split()::2])


print('YNeos'[1 - eval(input().replace(' ', '*')) & 1::2])


(A, B) = list(map(int, input().split()))
count = 0
for C in range(1, 4):
	if A * B * C % 2 == 1:
		count = count + 1
if count >= 1:
	print('Yes')
elif count == 0:
	print('No')


a = list(map(int, input().split()))
if 2 in a:
	print('No')
else:
	print('Yes')


(a, b) = input().split()
print('No' if '2' in a or '2' in b else 'Yes')


ab = map(int, input().split(' '))
print('Yes' if 2 not in ab else 'No')


(a, b) = list(map(int, input().split()))
if a * b in [1, 3, 9]:
	print('Yes')
else:
	print('No')


a = 'YNeos'
print(a[1::2] if '2' in input() else a[::2])


(n, m) = map(int, input().split())
x = n * m
if x % 2 == 1:
	print('Yes')
else:
	print('No')


(n, m) = map(int, input().split())
print('No' if n * m % 2 == 0 else 'Yes')


(A, B) = map(int, input().split())
print('YNeos'[1 - A * B % 2::2])


print('No' * ('2' in input()) or 'Yes')


print('YNeos'[eval(input().replace(' ', '*')) % 2 == 0::2])


(a, b) = map(int, input().split())
print(a * b % 2 and 'Yes' or 'No')


num = list(map(int, input().split()))
print('Yes' if num[0] * num[1] % 2 == 1 else 'No')


(A, B) = input().split()
print('No' if '2' in A or '2' in B else 'Yes')


(a, b) = map(int, input().split())
ans = 'No'
for i in range(1, 4):
	if a * b * i % 2 != 0:
		ans = 'Yes'
		break
print(ans)


(a, b) = map(int, input().split())
c = 3
print('Yes' if a * b * c % 2 == 1 else 'No')


(a, b) = map(int, input().split())
ans = 'No'
if a % 2 != 0 and b % 2 != 0:
	ans = 'Yes'
print(ans)


(a, b) = map(int, input().split())
if a ** 2 * b % 2 != 0 or a * b ** 2 % 2 != 0:
	print('Yes')
elif a ** 2 * b % 2 == 0 or a * b ** 2 % 2 == 0:
	print('No')


(a, b) = map(int, input().split())
cnt = 0
for c in range(1, 4):
	if a * b * c % 2 == 1:
		print('Yes')
		break
	else:
		cnt += 1
		if cnt == 3:
			print('No')
			break


(a, s, b) = input()
print(['No', 'Yes'][int(a) * int(b) % 2])


print('Yes' if all((int(i) % 2 != 0 for i in input().split())) else 'No')


(A, B) = map(int, input().split())
print(['No', 'Yes'][A * B % 2])


(A, B) = [int(x) for x in input().split()]
print('Yes' if A * B % 2 == 1 else 'No')


print('Yes' if list(map(int, input().split())).count(2) == 0 else 'No')


(a, b) = [int(s) for s in input().split(' ')]
print('Yes' if a * b % 2 != 0 else 'No')


def main():
	(a, b) = list(map(int, input().split()))
	for c in range(1, 4):
		if a * b * c % 2 == 1:
			print('Yes')
			return
	print('No')

def __starting_point():
	main()
__starting_point()


(a, b) = map(int, input().split())
flag = 0
for i in range(1, 4):
	if a * b * i % 2 != 0:
		flag = 1
		break
	else:
		continue
if flag == 1:
	print('Yes')
else:
	print('No')


a = list(map(int, input().split()))
set_a_b = set(a)
even_count = 0
for i in set_a_b:
	if i % 2 == 0:
		even_count += 1
if even_count == 0:
	print('Yes')
else:
	print('No')


import sys
(A, B) = list(map(int, input().split()))
ans = 0
for i in range(3):
	if A * B * (i + 1) % 2 == 1:
		print('Yes')
		return
print('No')


s = input().split()
print('Yes' if not '2' in s else 'No')


(A, B) = map(int, input().split())
check = False
for C in range(1, 4):
	if A * B * C % 2 == 1:
		check = True
print('Yes' if check else 'No')