Problem:


Score : 200 points

Problem Statement

We have a grid with N rows and M columns of squares. Initially, all the squares are white.

There is a button attached to each row and each column.
When a button attached to a row is pressed, the colors of all the squares in that row are inverted; that is, white squares become black and vice versa.
When a button attached to a column is pressed, the colors of all the squares in that column are inverted.

Takahashi can freely press the buttons any number of times. Determine whether he can have exactly K black squares in the grid.

Constraints

1 \leq N,M \leq 1000

0 \leq K \leq NM

Input

Input is given from Standard Input in the following format:

N M K

Output

If Takahashi can have exactly K black squares in the grid, print Yes; otherwise, print No.

Sample Input 1

2 2 2

Sample Output 1

Yes

Press the buttons in the order of the first row, the first column.

Sample Input 2

2 2 1

Sample Output 2

No

Sample Input 3

3 5 8

Sample Output 3

Yes

Press the buttons in the order of the first column, third column, second row, fifth column.

Sample Input 4

7 9 20

Sample Output 4

No



Sample input:
2 2 2


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())

for i in range(m+1):
    a = k - i * m
    b = n - 2 * i
    if b != 0 and a % b == 0 and 0 <= a // b <= m:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())

if k % n % m == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# code-festival-2017-qualaB - fLIP
def main():
    n, m, k = list(map(int, input().rstrip().split()))
    for i in range(n):
        for j in range(m):
            if i * (m - j) + j * (n - i) == k:
                print("Yes")
                return
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

N, M, K = map(int, input().split())
Possible = []
for i in range(math.ceil(N / 2) + 1):
	for j in range(M):
		Possible.append(N * i + M * j)
if K in Possible:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import math

N, M, K = map(int, input().split())
Possible = []
for i in range(math.ceil(N / 2) + 1):
	for j in range(M):
		Possible.append(M * i + N * j)
if K in Possible:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
B - fLIP
https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_b

"""
import sys


def solve(N, M, K):
    if K % N == 0 or K % M == 0:
        return 'Yes'
    for y in range(N//2 + 2):
        for x in range(M//2 + 2):
            if x * y + (N - y) * (M - x) == K:
                return 'Yes'
    return 'No'


def main(args):
    N, M, K = map(int, input().split())
    ans = solve(N, M, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
B - fLIP
https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_b

"""
import sys


def solve(N, M, K):
    if K == 0:
        return 'Yes'
    for y in range(N//2 + 2):
        for x in range(M//2 + 2):
            if x * y + (N - y) * (M - x) == K:
                return 'Yes'
    return 'No'


def main(args):
    N, M, K = map(int, input().split())
    ans = solve(N, M, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
B - fLIP
https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_b

"""
import sys


def solve(N, M, K):
    for y in range(N//2 + 2):
        for x in range(M//2 + 2):
            if x * y + (N - y) * (M - x) == K:
                return 'Yes'
    return 'No'


def main(args):
    N, M, K = map(int, input().split())
    ans = solve(N, M, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
for i in range(n):
    for j in range(m):
        x=i*(m-j)+j*(n-i)
        if x>=k:break
    if x==k:
        print("Yes")
        break
else:print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())

for i in range(n):
    for j in range(m):
        if (n-i)*j + (m-j)*i == k:
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
n,m,k = map(int, input().split())
def check():
    globals()
    for i in range(n+1):
        for j in range(m+1):
            if j*(n-i)+i*(m-j)==k:
                return True
    return False
if check():
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
ans=['Yes','No']
i=1
for a in range(n+1):
    for b in range(m+1):
        if k==a*m+b*n-a*b:
            i=0
print(ans[i])

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
s=n*m
flag=False
for i in range(n):
  for j in range(m):
    if s-(n-i)*(m-j)==k:
      flag=True
if flag==True:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
flag=False
if n==1 or m==1:
  print('Yes')
else:
  for i in range(n):
    for j in range(m):
      if i*j + (n-i)*(m-j) + k == n*m:
        flag=True
  if flag:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
flag=False
for i in range(n):
  for j in range(m):
    if i*j + (n-i)*(m-j) + k == n*m:
      flag=True
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
s=set()
for i in range(n+1):
  for j in range(m+1):
    s.add(i*(n-j)+(n-i)*j)
if k in s:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
s=set()
for i in range(n+1):
  for j in range(m+1):
    s.add(i*j)
if k in s:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,M,K=MAP()

for i in range(N+1):
    for j in range(M+1):
        if i*(N-j)+j*(M-i)==K:
            Yes()
            exit()
No()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,M,K=MAP()

for i in range(1, N+1):
    for j in range(1, M+1):
        if i*(N-j)+j*(M-i)==K:
            Yes()
            exit()
No()

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
flag = 0
for i in range(N+1):
  for j in range(M+1):
    if N*M-(N-i)*(M-j) == K:
      flag = 1
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
flag = 0
for i in range(N+1):
  for j in range(M+1):
    if (N-i)*(M-j) == K:
      flag = 1
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
from itertools import product

N, M, K = map(int, input().split())
S = set()

for i, j in product(range(N), range(M)):
    S.add((M-j)*i + (N-i)*j)

print("Yes" if K in S else "No")

Submission status: Wrong Answer

Solution code:
a,b,k=map(int,input().split())
for s in range(a+1):
    for t in range(b+1):
        if k==(a-t)*s+(b-s)*t:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
a,b,k=map(int,input().split())
c=[]
for s in range(a+1):
    for t in range(b+1):
        c.append((a-t)*s+(b-s)*t)
print(["No","Yes"][k in c])

Submission status: Wrong Answer

Solution code:
from numpy import*
a,b,k=map(int,input().split())
c=ones((a,b))
c=set([int(sum(c[:s,t:])+sum(c[s:,:t]))for t in range(b)for s in range(a)])
print(["No","Yes"][k in c])

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
for i in range(N+1):
  for j in range(M+1):
    if N*M - i*j == K:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
for i in range(N+1):
  for j in range(M+1):
    if i*j == K:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N,M,K=map(int,input().split(' '))
print('Yes') if K in [(N-a)*b+(M-b)*a for a in range(N+1) for b in range(N+1)] else print('No')

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
for i in range(m):
	for j in range(n):
		if i*(m - j) + j*(n - i) == k:
			print("Yes")
			exit()
print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
for i in range(n):
	for j in range(m):
		if i*(m - j) + j*(n - i) == k:
			print("Yes")
			exit()
print("No")

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
ansx = -1
ansy = -1
for k in range(N):
  for l in range(M):
    if k*(M-l)+l*(N-k) == K:
      ansx = k
      ansy = l
if ansx == -1 and ansy == -1:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
ansx = -1
ansy = -1
for k in range(N):
  for l in range(M):
    if k*(M-l)+l*(N-k) == K:
      ansx = k
      ansx = l
if ansx == -1 and ansy == -1:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,open(0).read().split())
if k%n==0 or k%m==0:
    print("Yes")
elif k%(n+m)==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
f=False
for i in range(n+1):
  for j in range(m+1):
    if (m-i)*j+(n-j)*i==k:
      f=True
if f:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
f=False
for i in range(n):
  for j in range(m):
    if (n-j)*i+(m-i)*j==k:
      f=True
if f:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
n,m,k = (int(i) for i in input().split())
ans = 'No'
for i in range(n):
  for j in range(m):
    if i*(n-j)+j*(m-i) == k:
      ans = 'Yes'
      break
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,k = (int(i) for i in input().split())
ans = 'No'
for i in range(n+1):
  for j in range(m+1):
    if i*(n-j)+j*(m-i) == k:
      ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

r = 0
c = 0
sum = 0
m = max(N, M)
for i in range(m+1):
	if (K != i*N):
		if (M-N-r+c != 0):
			a = K-i*N
			b = (M-N-r+c)
			q, mod = divmod(a, b)
			if (mod == 0 and q <= M):
				print('Yes')
				exit()
			else:
				continue
		else:
			continue
	else:
		print('Yes')
		exit()
print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
for k in range(1,N+1):
    for l in range(1,M+1):
        if K == (k*(M - l) + (N - k)*l):
            print("Yes")
            quit()
print("No")

Submission status: Wrong Answer

Solution code:
from collections import deque

N, M, K = map(int, input().split())
r_c = deque([(0, 0)])

r = 0
c = 0
sum = 0
for i in range(1000010):
	if (sum > 10000*K):
		print('No')
		exit()
	sum = i*N
	for c in range(i+1):
		r*N+c*M-r*c
		if (K == sum):
			print('Yes')
			exit()
		sum += M-N-r+c

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]

#A
"""
s = S()
if s[0] != "A":
    print("WA")
else:
    count = []
    for i in range(2,len(s)-1):
        if s[i] == "C": count.append(i)
    if len(count) != 1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if i not in count:
                if s[i] == s[i].upper():
                    print("WA")
                    quit()
        print("AC")
"""

#B
n,m,k = LI()
for i in range((n+1)//2):
    if (k - m*i) % (n - 2*i) == 0 and (k-m*i)//(n-2*i) >= 0:
        print("Yes")
        quit()
print("No")
#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]

#A
"""
s = S()
if s[0] != "A":
    print("WA")
else:
    count = []
    for i in range(2,len(s)-1):
        if s[i] == "C": count.append(i)
    if len(count) != 1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if i not in count:
                if s[i] == s[i].upper():
                    print("WA")
                    quit()
        print("AC")
"""

#B
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
n,m,k = LI()
for i in range(n//2):
    if (k - m*i) % (n - 2*i) == 0 and (k-m*i)//(n-2*i) >= 0:
        print("Yes")
        quit()
print("No")
#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())

if K%N == 0 or K%M == 0:
    print('Yes')
else:
    for n in range(N+1):
        for m in range(M+1):
            cnt = n*M + m*N - n*m*2
            if cnt == K:
                print('Yes')
                exit()
print('No')

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())

if K%N == 0 or K%M == 0:
    print('Yes')
else:
    N,M = max(N,M), min(N,M)
    tmp = K // M

    K -= tmp

    cnt = 0
    while cnt < M:
#        print(K)
        if K != 0:
            K = K + (N - tmp)
        else:
            break

        cnt += 1

    if K == 0:
        print('Yes')
    else:
        print('No')
#    print(K)

Submission status: Wrong Answer

Solution code:
import itertools
N, M, K = [int(_) for _ in input().split()]
for i, j in itertools.product(range(N), range(M)):
    if (N-i)*j+i*(M-j) == K:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
import itertools
N, M, K = [int(_) for _ in input().split()]
for i, j in itertools.product(range(N), range(M)):
    if (N-i)*j+i*(M-j) == K:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
t=False
for i in range(n+1):
    for j in range(m+1):
        if (n-i)*j+(m-j)*i==k:
            t=True
            print(i,j)
            break
print("Yes" if t else "No")

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
t=False
for i in range(1,n+1):
    for j in range(1,m+1):
        if (n-i)*j+(m-j)*i==k:
            t=True
            print(i,j)
            break
print("Yes" if t else "No")

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
if k%n==0 or k%m==0:
    print("Yes")
else:
    t=False
    for i in range(1,max(n,m)):
        for j in range(1,max(n,m)):
            if (n-i)*j+(m-j)*i==k:
                t=True
                print(i,j)
                break
    print("Yes" if t else "No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif int((N * M) / 2) == K or int((N * M) / 2 + 1) == K:
    print("Yes")
elif N == 1 or M == 1:
    print("Yes")
elif (N * M) - (N + M - 1) == K:
    print("Yes")
elif int((N * M) / 4) == K or int((N * M) * (3/4)) == K:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif int((N * M) / 2) == K or int((N * M) / 2 + 1) == K:
    print("Yes")
elif N == 1 or M == 1:
    print("Yes")
elif (N * M) - (N + M - 1) == K:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif N == 1 or M == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif int((N * M) / 2) == K or int((N * M) / 2 + 1) == K:
    print("Yes")
elif N == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif int((N * M) / 2) == K or int((N * M) / 2 + 1) == K or int((N * M) / 2 - 1) == K:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif int((N * M) / 2) == K or int((N * M) / 2 + 1) == K:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))


if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
elif (N * M) / 2 == K or(N * M) / 2 + 1 == K:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int, input().split()))


if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
a=0
b=0
c=k
if(n>m):
    a = n
    b = m
else:
    a = m
    b = n
for i in range(0,k+a,a):
    if (k - i < a):
        c = k-i
        break
for i in range(0,c+b,b):
    if (c-i<b):
        c = c-i
        break
if(c == 0):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
a=0
b=0
c=k
if(n>m):
    a = n
    b = m
else:
    a = m
    b = n
for i in range(0,k+a,a):
    if (k - i < a):
        c = k-i
        break
for i in range(0,c+b,b):
    if (c-i<b):
        c = c-i
        break
if(c == 0):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
A = []

for y in range(1,N+1) :
    for x in range(1,M+1) :
        a = y*x + (N-y)*(M-x)
        A.append(a)
if K in A :
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())

for i in range(n):
    for j in range(m):
        if i*(m-j)+(n-i)*j==k:
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
P = input().split()
N = int(P[0])
M = int(P[1])
K = int(P[2])


for i in range(0,N+1):
    for j in range(0,M+1):
        if(i * (M - j) + j * (M - i) == K):
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
P = input().split()
N = int(P[0])
M = int(P[1])
K = int(P[2])


for i in range(0,N):
    for j in range(0,M):
        if(i * (N - j) + j * (M - i) ==K):
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
n, m, k = map(int, input().split())
for i in range(n):
    for j in range(m):
        if i*m + j*n -2*i*j == k:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
a='No'
for i in range(n):
  for j in range(m):
    if j*(n-i)+i*(m-j)==k:
      a='Yes'
      break
print(a)

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
s = set()
for i in range(1,N+1):
    for j in range(1,M+1):
        s.add(i*(N-j)+j*(M-i))
if list(s).count(K)>0: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = list(map(int,input().strip().split(' ')))
import itertools
flg = 0
for i,j in itertools.product([k for k in range(N)],[k for k in range(M)]):
    kuro = M * i + N * j -2 * i * j
    if kuro == K:
        flg = 1
        break
if flg == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
s = set()
for i in range(N+1):
    for j in range(M+1):
        s.add(i*(N-j)+j*(M-i))
if list(s).count(K)>0: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


for a in range(N+1):
    for b in range(M+1):
        if b * (N-1) + a * (M-1) == K:
            print('Yes')
            exit()


print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


for a in range(N+1):
    for b in range(M+1):
        if a * (N-1) + b * (M-1) == K:
            print('Yes')
            exit()


print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


for a in range(N+1):
    for b in range(M+1):
        if N * a + M * b - 2 * a * b == K:
            print('Yes')
            exit()


print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


for a in range(N+1):
    for b in range(M+1):
        if K == N * a + M * b - 2 * a * b:
            print('Yes')
            exit()


print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


if K % M == 0 or K % N == 0:
    print('Yes')
    exit()
    quit()
else:
    for a in range(N+1):
        for b in range(M+1):
            if K == N * a + M * b - 2 * a * b:
                print('Yes')
                exit()
                quit()
    print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


if K % M == 0 or K % N == 0:
    print('Yes')
    exit()
else:
    for a in range(N+1):
        for b in range(M+1):
            if K == N * a + M * b - 2 * a * b:
                print('Yes')
                exit()
    print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


if K % M == 0 or K % N == 0:
    print('Yes')
    quit()
else:
    for a in range(N+1):
        for b in range(M+1):
            if K == N * a + M * b - 2 * a * b:
                print('Yes')
                quit()
    print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


if K % M == 0 or K % N == 0 or K == 0:
    print('Yes')
    quit()
else:
    A = int(K / N) + 1
    B = int(K / M) + 1
    for a in range(A+1):
        for b in range(B+1):
            if K == N * a + M * b - 2 * a * b:
                print('Yes')
                quit()
    print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())


if K % M == 0 or K % N == 0:
    print('Yes')
    quit()
else:
    A = int(K / N) + 1
    B = int(K / M) + 1
    for a in range(A+1):
        for b in range(B+1):
            if K == N * a + M * b - 2 * a * b:
                print('Yes')
                quit()
    print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map( int, input().split())
Flag = False
ans = 'No'
for i in range(1,N+1):
    for j in range(1,M+1):
        if (M-j)*i + (N-i)*j == K:
            ans = 'Yes'
            Flag = True
            break
    if Flag == True:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
for i in range(N + 1):
    for j in range(M + 1):
        if K == i * (N - j) + j * (M - i):
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

H,W,K = inpl()

for y in range(H):
	for x in range(W):
		if K == y*W + x*H - x*y*2:
			print('Yes')
			sys.exit()

print('No')

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
ans = 0
for i in range(1, N + 1):
    for j in range(1, M + 1):
        if K == N * j + M * i - 2 * i * j:
            ans = 1
            break
if ans == 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())
ans = 0
for i in range(N):
    for j in range(M):
        if K == N * j + M * i - i * j:
            ans = 1
            break
if ans == 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if K == N*i + abs(N-i) * j:
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if K == N*i + (N-i) * j:
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if K == N*i + (N-i) * j:
            print(i, j)
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if K == N*i + (M*(j-i)):
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if K == N*i + (M*(j-i)):
            print(i, j)
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
'''
黒マスの条件
行ボタン押 and (not 列ボタン押)
(not 行ボタン押） and 列ボタン押

行列の押したボタンは上左詰めできるので、
位置は関係がない
押したボタン数を考えたらよい

k, lを行、列ボタンの押下数とする
'''

N, M, K = map(int, input().split())
flg = False
for k in range(1, N+1):
    for l in range(1, M+1):
        if K == k * (M - l) + l * (N - k):
            flg = True
            break
print('Yes' if flg else 'No')

Submission status: Wrong Answer

Solution code:
'''
黒マスの条件
行ボタン押 and (not 列ボタン押)
(not 行ボタン押） and 列ボタン押

行列の押したボタンは上左詰めできるので、
位置は関係がない
押したボタン数を考えたらよい

k, lを行、列ボタンの押下数とする
'''

N, M, K = map(int, input().split())
flg = False
for k in range(N):
    for l in range(M):
        if K == k * (M - l) + l * (N - k):
            flg = True
            break
print('Yes' if flg else 'No')

Submission status: Wrong Answer

Solution code:
N,M,K = [int(i) for i in input().split()]

ans = 'No'
for j in range(N+1):
  for k in range(M+1):
    if j * (M - 2) + k * (N - 2) == K:
      ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
N,M,K=map(int,input().split())
for i in range(N):
  for j in range(M):
    if i*(M-j) + j*(N-i) == K:
      print('Yes')
      exit()
print('No')

Submission status: Wrong Answer

Solution code:
n,m,k = (int(i) for i in input().split())
flag = False
for i in range(0,m):
	for j in range(0,n):
		if k==i*n+j*m-2*i*j:
			flag = True
			break
	if flag: break
if flag: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
n,m,k = list(map(int,input().split()))
ans = 'No'
for i in range(n):
    for j in range(m):
        if i * m + j * n - 2 * i * j == k:
            ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
s = []
for i in range(n//2+1):
    for j in range(m//2+1):
        s.append(i*j)
        s.append(n*m-i*j)
if k in s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    """
    0行変更：0
    1行変更：N
    1行変更、1列変更：1つだけ戻る
        N +  M - 2
        (N - 1) + (M - 1)
    2行変更、1列変更：2つだけ戻る
        2N + M - 4
        (2N - 2) + (M - 2)
    2行変更、2列変更：4つだけ戻る
        2N + 2M - 8
        (2N - 4) + (2M - 4)
    """
    N, M, K = map(int, input().split())

    if K % N == 0 or K % M == 0:
        print("Yes")
        return

    for n in range(1, N+1):
        for m in range(1, M+1):
            x = n * N + m * M - (2 * n * m)
            if x == K:
                print("Yes")
                return

    print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    """
    0行変更：0
    1行変更：N
    1行変更、1列変更：1つだけ戻る
        N +  M - 2
        (N - 1) + (M - 1)
    2行変更、1列変更：2つだけ戻る
        2N + M - 4
        (2N - 2) + (M - 2)
    2行変更、2列変更：4つだけ戻る
        2N + 2M - 8
        (2N - 4) + (2M - 4)
    """
    N, M, K = map(int, input().split())

    # can = False
    # if K % N == 0 or K % M == 0:
    #     can = True
    for n in range(0, N+1):
        for m in range(0, M+1):
            x = n * N + m * M - (2 * n * m)
            if x == K:
                print("Yes")
                return

    print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
for i in range(a):
    for m in range(b):
        if i*(a - m) + (b - i) * m == c:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
for i in range(a+1):
    for m in range(b+1):
        if i*(a - m) + (b - i) * m == c:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
for i in range(a+1):
    for m in range(b+1):
        if b * i + a * m == c:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

Solution code:
def solve():
    N, M, K = list(map(int, input().split(" ")))
    for i in range(N):
        for j in range(M):
            black = i*(M-j)+j*(N-i)
            if black == K:
                print("Yes")
                return
    print("No")

solve()

Submission status: Wrong Answer

Solution code:
N,M,K = map(int,input().split())
for n in range(N):
    for m in range(M):
        if n*m+(N-n)*(M-m) == K:
            print("Yes")
            exit()
print("No")