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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(N+1):
  for y in range(M+1):
    kuro = x*(M-y)+y*(N-x)
    if kuro == K:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

n, m, k = inm()


def solve():
    for x in range(n + 1):
        for y in range(m + 1):
            a = m * x + n * y - 2 * x * y
            if a == k:
                return True
    return False


print("Yes" if solve() else "No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')
import string
# string.ascii_lowercase
from bisect import bisect_left
MOD = int(1e9)+7
INF = float('inf')


def solve():
    # n, m = [int(x) for x in input().split()]
    n, m, k = [int(x) for x in input().split()]
    s = set()
    for i in range(n+1):
        for j in range(m+1):
            x = m * i + n * j - 2 * (i * j)
            s.add(x)

    if k in s:
        print("Yes")
    else:
        print("No")


t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

azyxwvutsrqponmlkjihgfedcb

"""

Submission status: Accepted

Solution code:
h,w,k = map(int,input().split())
for x in range(1001):
    for y in range(1001):
        if w*x + h*y - 2*x*y == k and 0<= x <= h and 0<= y <= w:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

# 行と列の組み合わせを全探索で試し、1回でも成立する場合は終了する
for i in range(n+1):
  for j in range(m+1):
    if i*(m-j) + j*(n-i) == k:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

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

for a in range(N+1):
  if N - 2*a != 0:
    if (K - a*M) % (N - 2*a) == 0:
      if M >= (K - a*M) / (N - 2*a) >= 0:
        ans = "Yes"
print(ans)

Submission status: Accepted

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

for k in range(N+1):
  for l in range(M+1):
    if k*(M-l) + l*(N-k) == K:
      ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,M,K=MI()
    flag=0
    
    for i in range(N+1):
        for j in range(M+1):
            temp=i*M+j*N-(i*j)*2
            if temp==K:
                flag=1
                break
            
            
    if flag:
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, M, K = MI()
    
    if K == 0:
        print('Yes')
        return

    for i in range(N+1):
        for j in range(M+1):
            jd = i * (M - j) + j * (N - i)
            # print(i, j, jd)
            if jd == K:
                print('Yes')
                return
    print('No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, M, K = MI()
    
    if K == 0:
        print('Yes')
        return

    for i in range(N+1):
        cnt = i * M
        for j in range(M+1):
            # jd = cnt + (N - i) * j - i * j
            jd = cnt + (N - 2 * i) * j
            # print(i, j, jd)
            if jd == K:
                print('Yes')
                return
    print('No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N+1):
    for j in range(M+1):
        if i*(M-j)+j*(N-i) == K:
            print('Yes')
            flag = 1
            break
        else:
            flag = 0
    if flag == 1:
        break
else:
    print("No")

Submission status: Accepted

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

flag = False
for y in range(n+1):
    if n - 2 * y == 0:
        continue
        
    x = (k - m * y) / (n - 2 * y)
    
    if (k - m * y) % (n - 2 * y) == 0 and (0 <= x and x <= m):
        flag = True
        break
print("Yes" if flag else "No")

Submission status: Accepted

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

flag = False
for y in range(m+1):
    for x in range(n + 1):
        if n * y + m * x - 2 * x * y == k:
            flag = True
            break
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,k = list(map(int, input().split()))
ans = "No"
for i in range(n+1):
    for j in range(m+1):
        val = i*j + (n-i)*(m-j)# - i*(m-j) - j*(n-i)
#         print(val)
        if val==k:
            ans = "Yes"
            break
    if ans=="Yes":
        break
print(ans)

Submission status: Accepted

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


for p in range(n+1):
    for q in range(m+1):
        ans=p*m + q*n - 2*p*q
        if(ans==k):
            print('Yes')
            sys.exit()
else:
    print('No')

Submission status: Accepted

Solution code:
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, m, k = MAP()
for i in range(n+1):
    for j in range(m+1):
        if k == i*(m-j) + (n-i)*j:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
n, m, k = [int(w) for w in input().split()]

cond = False

for i in range(n + 1):
    for j in range(m + 1):
        b = i * (m - j) + j * (n - i)
        if b == k:
            cond = True
            break
    if cond:
        break

print("Yes" if cond else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

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

print("No")

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#a = int(input())
	n, m, k = tin()
	#s = input()
	for ni in range(n+1):
		for mi in range(m+1):
			bn = ni*(m-mi) + (n-ni)*(mi)
			if bn == k:
				return 'Yes'
	return 'No'
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

if __name__ == "__main__":
    N, M, K = [int(x) for x in input().split(" ")]
    if M < N:
        N, M = M, N
    for x in range(0, N + 1):
        for y in range(0, M + 1):
            if x * (M - y) + (y * (N - x)) == K:
                print("Yes")
                sys.exit(0)
    print("No")

Submission status: Accepted

Solution code:
from itertools import product
n, m, k = map(int, input().split())

for i,j in product(range(n + 1), range(m + 1)):
    if i * (m - j) + j * (n - i) == k:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())


    def check(n, m, k):
        for i in range(n + 1):
            for j in range(m + 1):
                if i * j + (n - i) * (m - j) == k:
                    return True
        return False
    
    
    n, m, k = mi()
    print('Yes') if check(n, m, k) else print('No')
        


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'No'
for n_ in range(n+1):
    for m_ in range(m+1):
        if n_*(m-m_) + m_*(n-n_) == k:
            ans = 'Yes'

print(ans)

Submission status: Accepted

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

NG_flag = True

for i in range(0,N+1):
    for j in range(0,M+1):
        if i*M + j*N - 2*i*j == K:
            NG_flag = False
            print("Yes")
            break
    
    if NG_flag == False:
        break
else:
    print("No")

Submission status: Accepted

Solution code:
def readinput():
    n,m,k=list(map(int,input().split()))
    return n,m,k

def main(n,m,k):
    for x in range(0,m+1):
        for y in range(0,n+1):
            if (n-y)*x+y*(m-x)==k:
                return 'Yes'
    return 'No'

if __name__=='__main__':
    n,m,k=readinput()
    ans=main(n,m,k)
    print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_b
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def read_ints(): return list(map(int, read().split()))


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right


N, M, K = read_ints()
for n, m in product(range(N + 1), range(M + 1)):
    # n行,m列塗りつぶすと？
    if K == (M - m) * n + (N - n) * m:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
'''
Accepted    　:No
difficult   　:
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''


def myAnswer(N: int, M: int, K: int) -> int:
   ans = set([0])
   for i in range(M):
      ans.add(N * (i + 1))
      ans.add(M - (i + 1) + (N - 1) * (i + 1))
   for i in range(N):
      ans.add(M * (i + 1))
      ans.add(N - (i + 1) + (M - 1) * (i + 1))
   print(ans)
   return "Yes" if K in ans else "No"

def modelAnswer(N,M,K):
   for k in range(N + 1):
      for l in range(M + 1):
         if k * (M - l) + l * (N - k) == K:
            return "Yes"
   return "No"
def main():
   N, M, K=map(int, input().split())
   print(modelAnswer(N, M, K))
if __name__ == '__main__':
   main()

Submission status: Accepted

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

can=[]
for i in range(n+1):
    for j in range(m+1):
        can.append(n*j+i*m - 2*i*j)


# can_m=[]
# can_n=[]

# for i in range(m+1):
#     can_m.append(i*n)
# for i in range(m+1):
#     p = can_m[i]
#     for j in range(1,m):
#         s = i*n - i*j + j*(m-i)
#         can_m.append(s)

# for i in range(n+1):
#     can_n.append(i*m)
# for i in range(n+1):
#     p = can_n[i]
#     for j in range(1,n):
#         s = i*m - i*j + j*(n-i)
#         can_n.append(s)

if (k in can): #or (k in can_n):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N, M, K = MAP()

for i in range(N+1):
	for j in range(M+1):
		if M*i + N*j - 2*i*j == K:
			print("Yes")
			break
	else:
		continue
	break
else:
	print("No")

Submission status: Accepted

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

print('No')

Submission status: Accepted

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

for k in range(N+1):
    for l in range(M+1):
        if k * (M-l) + l * (N-k) == K:
            print("Yes")
            import sys
            sys.exit()

print("No")

Submission status: Accepted

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

for i in range(N+1):
    for j in range(M+1):
        if i*(M-j) + j*(N-i) == K:
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

N,M,K = map(int,readline().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h,w,k=map(int,input().split())
ans="No"
for i in range(h+1):
  for j in range(w+1):
    if i*j+(h-i)*(w-j) == k:
      ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
H,W,target = map(int,input().split())
res = 'No'
for w in range(0,W+1):
    for h in range(0,H+1):
        num_black = w * h + (W-w)*(H-h)
        if num_black == target:
            res = 'Yes'
print(res)

Submission status: Accepted

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

for r in range(N+1):
    for c in range(M+1):
        black = (M*r)+(N*c)-(r*c*2)
        if black == K:
            print('Yes')
            exit(0)
print('No')

Submission status: Accepted

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

black = 0

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

Submission status: Accepted

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*j+m*i-2*i*j==k:
            print("Yes")
            flag=1
            break
    if flag:
        break
if not flag:
    print("No")

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N,M,K = IL()
for a in range(N+1):
  for b in range(M+1):
    if (a*(M-b)+b*(N-a))==K:
      print("Yes")
      exit()
print("No")