AtCoder Beginner Contest 064 - RGB Cards

AtCoDeer has three cards, one red, one green and one blue.

An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.

We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.

Is this integer a multiple of 4?  

-----Constraints-----
 - 1 ≤ r, g, b ≤ 9

-----Input-----
Input is given from Standard Input in the following format:
r g b

-----Output-----
If the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO.

-----Sample Input-----
4 3 2

-----Sample Output-----
YES

432 is a multiple of 4, and thus YES should be printed.

Difficulty: EASY

Starter code:

Solutions:
rgb = int(input()[::2])
print('NO' if rgb % 4 else 'YES')


(r, g, b) = list(map(int, input().split()))
N = r * 100 + g * 10 + b
if N % 4 == 0:
	print('YES')
else:
	print('NO')


(r, g, b) = input().split()
l = int(r + g + b)
print('YES' if l % 4 == 0 else 'NO')


N = int(input().replace(' ', ''))
print('YES' if N % 4 == 0 else 'NO')


print('NO' if int(input().replace(' ', '')) % 4 else 'YES')


(r, g, b) = list(map(int, input().split()))
num = 10 * g + b
if num % 4 == 0:
	print('YES')
else:
	print('NO')


(r, g, b) = map(int, input().split())
print('YNEOS'[(g * 10 + b) % 4 != 0::2])


(a, b, c) = map(int, input().split())
s = 10 * b + c
print('YES' if s % 4 == 0 else 'NO')


print(['YES', 'NO'][int(input().replace(' ', '')) % 4 > 0])


print('YNEOS'[int(input().replace(' ', '')) % 4 != 0::2])


(a, b, c) = map(int, input().split())
x = str(a) + str(b) + str(c)
if int(x) % 4 == 0:
	print('YES')
else:
	print('NO')


(a, b, c) = map(int, input().split())
print('YNEOS'[(b * 10 + c) % 4 != 0::2])


print(['YES', 'NO'][int(input()[::2]) % 4 > 0])


print('NO' if eval(input().replace(' ', '')) % 4 else 'YES')


print(['YES', 'NO'][int(''.join(input().split())) % 4 != 0])


(r, g, b) = map(int, input().split())
rgb = r * 100 + g * 10 + b
if rgb % 4 == 0:
	print('YES')
else:
	print('NO')


print('YNEOS'[int(''.join(input().split())) % 4 != 0::2])


(r, g, b) = map(int, input().split())
print('NO' if (g * 10 + b) % 4 else 'YES')


(r, g, b) = list(map(int, input().split()))
input_rgb = r * 100 + g * 10 + b
result = 'ret'
if input_rgb % 4 == 0:
	result = 'YES'
else:
	result = 'NO'
print(result)


print('NO' if int(''.join(list(input().split()))) % 4 else 'YES')


(r, g, b) = map(int, input().split())
judged = int(str(g) + str(b))
if judged % 4 == 0:
	print('YES')
else:
	print('NO')


print('YNEOS'[min(int(input().replace(' ', '')) % 4, 1)::2])


rgb = list(input().split())
l = int(''.join(rgb))
print('NO' if l % 4 else 'YES')


n = ''.join(input().split())
print('YES') if int(n) % 4 == 0 else print('NO')


s = int(input()[::2])
print('NO' if s % 4 else 'YES')


s = int(''.join(input().split()))
print('YES' if s % 4 == 0 else 'NO')


n = int(input()[::2])
print('YES' if n & 3 == 0 else 'NO')


if int(''.join(input().split())) & 3:
	print('NO')
else:
	print('YES')


s = int(input().replace(' ', ''))
print('YES' if s % 4 == 0 else 'NO')


rgb = input().replace(' ', '')
print('YES' if int(rgb) % 4 == 0 else 'NO')


print('YES' * (int(input()[::2]) % 4 < 1) or 'NO')


print('YES' if int(''.join(input().split()[1:])) % 4 == 0 else 'NO')


(a, b, c) = input().split()
if int(b + c) % 4 == 0:
	print('YES')
else:
	print('NO')


r = input().replace(' ', '')
print('YES' if int(r) % 4 == 0 else 'NO')


(r, g, b) = list(map(str, input().split()))
answer = int(r + g + b)
if answer % 4 == 0:
	print('YES')
else:
	print('NO')


(r, g, b) = map(int, input().split())
print(['NO', 'YES'][(10 * g + b) % 4 == 0])


N = int(''.join(map(str, input().split())))
print(('NO', 'YES')[N % 4 == 0])


a = list(map(int, input().split()))
if (a[0] * 100 + a[1] * 10 + a[2]) % 4 == 0:
	print('YES')
else:
	print('NO')


(r, g, b) = list(map(str, input().split()))
i = int(r + g + b)
result = 'NO'
if i % 4 == 0:
	result = 'YES'
print(result)


(r, g, b) = (int(x) for x in input().split())
s = 100 * r + 10 * g + b
if s % 4 == 0:
	print('YES')
else:
	print('NO')


(R, G, B) = input().split()
print('YES' if int(R + G + B) % 4 == 0 else 'NO')


(r, g, b) = map(int, input().split())
x = 2 * g + b
print('YES' if x % 4 == 0 else 'NO')


a = input().split()
print('YES' if int(a[0] + a[1] + a[2]) % 4 == 0 else 'NO')


A = input().split()
print('YES' if int(''.join(A)) % 4 == 0 else 'NO')


a = int(input().replace(' ', ''))
print('YES' if a % 4 == 0 else 'NO')


(r, g, b) = input().split()
ans = int(r) * 100 + int(g) * 10 + int(b)
if ans % 4 == 0:
	print('YES')
elif ans % 4 != 0:
	print('NO')


(r, g, b) = map(str, input().split())
sumstr = r + g + b
sumint = int(sumstr)
if sumint % 4 == 0:
	print('YES')
else:
	print('NO')


e = input()
f = (int(e[2]) * 10 + int(e[4])) % 4 == 0
print(['NO', 'YES'][f])


(a, b, c) = map(int, input().split())
print(['NO', 'YES'][(b * 10 + c) % 4 == 0])


i = int(input().replace(' ', ''))
print('YES' if i % 4 == 0 else 'NO')


(r, g, b) = map(int, input().split())
result = int('{}{}{}'.format(r, g, b))
if result % 4 == 0:
	print('YES')
else:
	print('NO')


n = ''
for s in input().split():
	n += s
if int(n) % 4 == 0:
	print('YES')
else:
	print('NO')


print(['NO', 'YES'][int(''.join(input().split())) % 4 < 1])


N = input().split()
print(['YES', 'NO'][not int(''.join(N)) % 4 == 0])


number = int(''.join(input().split()))
if number % 4 == 0:
	print('YES')
else:
	print('NO')


(x, a, b) = map(int, input().split())
print('YES' if (10 * a + b) % 4 == 0 else 'NO')


a = int(input().rstrip().replace(' ', ''))
print('NO' if a % 4 else 'YES')


(_, g, b) = input().split()
print('YNEOS'[int(g + b) % 4 != 0::2])


print('NYOE S'[int(''.join(input().split())) % 4 == 0::2])


n = input().replace(' ', '')
print('YES' if int(n) % 4 == 0 else 'NO')


x = input().split()
print('YES' if int(''.join(x)) % 4 == 0 else 'NO')


print('YES' if int(input().strip().replace(' ', '')) % 4 == 0 else 'NO')


print('YES' if int(input()[::2]) % 4 == 0 else 'NO')


(a, b, c) = map(int, input().split())
print('NO' if (a * 100 + b * 10 + c) % 4 else 'YES')


(r, g, b) = map(int, input().split())
if 1 <= r <= 9 and 1 <= g <= 9 and (1 <= b <= 9) and ((100 * r + 10 * g + b) % 4 == 0):
	print('YES')
else:
	print('NO')


(a, b, c) = [int(s) for s in input().split()]
if (10 * b + c) % 4 == 0:
	print('YES')
else:
	print('NO')


def iroha():
	(a, b, c) = input().split()
	num = int(a + b + c)
	print('YES' if num % 4 == 0 else 'NO')

def __starting_point():
	iroha()
__starting_point()


a = int(''.join(list(input().split())))
print('YES' if a % 4 == 0 else 'NO')


(X, A, B) = map(int, input().split())
print(['NO', 'YES'][(A * 10 + B) % 4 == 0])


l = int(''.join(input().split())) % 4
print('YES') if l == 0 else print('NO')


c = input().split()
print(['NO', 'YES'][int(c[1] + c[2]) % 4 is 0])


print(['NO', 'YES'][int(''.join(list(input().split()))[1:]) % 4 == 0])


S = input().replace(' ', '')
print('YES' if int(S) % 4 == 0 else 'NO')


x = int(input().replace(' ', ''))
print('YES' if x % 4 == 0 else 'NO')


print('YNEOS'[not eval(input().replace(' ', '') + '%4==0')::2])


num = input().replace(' ', '')
if int(num) % 4 == 0:
	print('YES')
else:
	print('NO')


print('YES' if int(input().replace(' ', '')[1:]) % 4 == 0 else 'NO')


(a, b, c) = input().split()
print(['NO', 'YES'][int(a + b + c) % 4 == 0])


(r, g, b) = map(int, input().split())
print('NYOE S'[(g * 10 + b) % 4 == 0::2])


rgb = list(map(int, input().split()))
l = ''.join((str(n) for n in rgb))
if int(l) % 4 == 0:
	print('YES')
else:
	print('NO')


print('NYOE S'[int(input().replace(' ', '')) % 4 == 0::2])


c = input().split()
a = ['NO', 'YES']
print(a[int(''.join(c[1:])) % 4 == 0])


(a, b, c) = input().split()
print('NYOE S'[int(a + b + c) % 4 == 0::2])


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

def lstr():
	return input().split()

def lint():
	return list(map(int, input().split()))

def lintdec():
	return list([int(x) - 1 for x in input().split()])

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
print('NO' if int(''.join(lstr())) % 4 else 'YES')


(r, g, b) = map(int, input().split())
num = int(str(r) + str(g) + str(b))
if (1 <= r and r <= 9) and (1 <= g and g <= 9) and (1 <= b and b <= 9):
	if num % 4 == 0:
		print('YES')
	else:
		print('NO')


(_, x, y) = map(int, input().split())
print('YES' if (10 * x + y) % 4 == 0 else 'NO')


(r, g, b) = input().split()
num = r + g + b
print('YES' if eval(num) % 4 == 0 else 'NO')