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

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






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






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)]


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()


def DD(arg): return defaultdict(arg)



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


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


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


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


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


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


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


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


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))))


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




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")

Solution (Python):

n,m,K=map(int,input().split());print("YNeos"[all(k*m-K+l*n-k*l*2for k in range(n+1)for l in range(m+1))::2])

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

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





cnt=0
for p in range(n+1):
    for q in range(m+1):
        if p*m+q*n-2*p*q==k:
            cnt+=1
if cnt>0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
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) * 2 == K:
            print('Yes')
            exit()
print('No')

Solution (Python):
N, M, K = map(int, input().split())
if K % N == 0 or K % M == 0:
    print('Yes')
    exit()
candidates = set()
for i in range(1, N):
    curr = i * M
    for j in range(1, M):
        curr += N - 2 * i
        candidates.add(curr)
print('Yes') if K in candidates else print('No')

Solution (Python):
N, M, K = map(int, input().split())
if K % N == 0 or K % M == 0:
    print('Yes')
    exit()
candidates = set()
for i in range(1, N):
    curr = i * M
    for j in range(1, M):
        curr += N - 2 * i
        candidates.add(curr)
for j in range(1, M):
    curr = j * N
    for i in range(1, N):
        curr += M - 2 * j
        candidates.add(curr)
print('Yes') if K in candidates else print('No')

Solution (Python):
from functools import reduce
from decimal import *
from operator import mul

def main():
    w, h, k = input_list()
    for x in range(w+1):
        for y in range(h+1):
            if x*(h-y) + y*(w-x) == k:
                print('Yes')
                exit()
    print('No')

def count_tento(l, cur):
    count = 0
    for v in l:
        if v > cur:
            count += 1
    return count

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

if __name__ == '__main__':
    main()

Solution (Python):
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

INF = 10**18
eps = 10**-7

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

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

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

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

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

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

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

Solution (Python):




















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

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

print("No")

Solution (Python):

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

def main(N, M, K):
    for i in range(0, N+1):
        for j in range(0, M+1):
            if i * (M - j) + j * (N - i) == K:
                return True
    return False

res = main(N, M, K)

if res == True:
    print('Yes')
else:
    print('No')

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

for n in range(N + 1):
    if (N - 2 * n) == 0:
        continue
    if (K - n * M) % (N - 2 * n) == 0:
        if 0 <= (K - n * M) // (N - 2 * n) <= M:
            print ('Yes')
            exit()

print ('No')

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

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

print ('No')

Solution (Python):

"""
Created on Tue Jun  2 22:08:10 2020

@author: NEC-PCuser
"""

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

Solution (Python):
n,m,k = map(int,input().split())
for a in range(n+1):
  for b in range(m+1):
    if k == a*m+b*n-2*a*b:
      print('Yes')
      exit()
print('No')

Solution (Python):
n, m, k = 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")

Solution (Python):
import sys

import math


from collections import deque

from fractions  import gcd

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

Solution (Python):
N, M, K = map(int,input().split())
jdg = 0
for L in range(1, N+1):
    for C in range(1, M+1):
        if ((M-C)*L + (N-L)*C == K or (M-C)*L + (N-L)*C == N*M-K) and jdg == 0:
            jdg += 1
            print("Yes")
            break
if jdg == 0 :
    print("No")

Solution (Python):
n,m,k=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')
      quit()
print('No')

Solution (Python):
n, m, k = 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")

Solution (Python):
n,m,k=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')

Solution (Python):
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")

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

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

print(ans)

Solution (Python):
N,M,K=map(int,input().split())
flag=False
for n in range(N+1):
    for m in range(M+1):
        if (N-n)*m+(M-m)*n==K:
            flag=True
print("Yes" if flag else "No")

Solution (Python):
n, m, k = map(int, input().split())
L = set()
for i in range(m + 1):
    for j in range(n + 1):
        c = n * i + m * j - i * j * 2
        if c >= 0:
            L.add(c)
if k in L:
    print('Yes')
else:
    print('No')

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

if k == 0 or k == n * m:
    print("Yes")
    exit()

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

Solution (Python):
n,m,K=map(int,input().split());print("YNeos"[all(k*m-K+l*n-k*l*2for k in range(n+1)for l in range(m+1))::2])

Solution (Python):
n,m,K=map(int,input().split());print("YNeos"[all(k*(m-l)-K+l*(n-k)for k in range(n+1)for l in range(m+1))::2])

Solution (Python):
n, m, K = map(int, input().split())
print("YNeos"[all(k*(m-l)+(n-k)*l-K for k in range(n+1) for l in range(m+1))::2])

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

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

val = []

for i in range(0, n + 1):
    for j in range(1, m + 1):
        x = i * j + (n - i) * (m - j)
        val.append(x)
        
val = set(val)

print("Yes" if k in val else "No")

Solution (Python):
from itertools import accumulate, count

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

"""
3 5 8

 



   




   
"""

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")

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

Solution (Python):
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-(i*j)*2 == K:
         print("Yes")
         exit()
print("No")

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

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

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

print('No')

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

Solution (Python):
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')

Solution (Python):
N, M, K = [int(_) for _ in 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")

Solution (Python):
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")

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

Solution (Python):
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")

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

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

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

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

for x in range(n+1):
    for y in range(m+1):
        num_of_blacks = x*m + y*n - 2*x*y
        if num_of_blacks == k:
            print('Yes')
            exit()
print('No')

Solution (Python):
N,M,K = [int(hoge) for hoge in input().split()]
ans = "No"
for n in range(N+1):
    for m in range(M+1):
        if m*(N-n) +n*(M-m)  == K:
            ans = "Yes"
print(ans)

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

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

Solution (Python):
a,b,c = map(int, input().split())
can = False
for i in range(a + 1):
    for j in range(b + 1):
        cnt = i * (b - j) + j * (a - i)
        if cnt == c:
            can = True
print("Yes" if can else "No")

Solution (Python):
import sys
N, M, K = map(int, input().split())

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

Solution (Python):
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")

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

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

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

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

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

Solution (Python):
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')

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, M, K = map(int, input().split())
    for n in range(N + 1):
        for m in range(M + 1):
            num = N * m + M * n - 2 * m * n
            if K == num:
                print("Yes")
                return

    print("No")
    return


if __name__ == "__main__":
    main()

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

cand=[]
for i in range(N+1):
    for j in range(M+1):
        cand.append(i*(M-j)+j*(N-i))

if K in cand:
    print("Yes")
else:
    print("No")

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

cand=[]
for i in range(N+1):
    for j in range(M+1):
        cand.append(i*(M-j)+j*(N-i))

if K in cand:
    print("Yes")
else:
    print("No")

Solution (Python):
n, m, k = map(int, input().split())
for nn in range(n+1):
    for mm in range(m+1):
        if nn*m+n*mm-2*nn*mm==k:
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')

Solution (Python):
n, m, k = map(int, input().split())
ok = False
for i in range(n+1):
    for j in range(m+1):
        if k == (n*j + m*i) - 2*i*j:
            ok = True

if ok:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

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

if __name__ == '__main__':
    main()

Solution (Python):
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)

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

for i in range(n):

    if (n-2*i) != 0 and (k-m*i) % (n-2*i) == 0:
        j = (k - m * i) // (n - 2 * i)
        if 0 <= j <= m:
            print('Yes')
            exit()
print('No')

Solution (Python):
n, m, k = map(int, input().split())
if n == 1 or m == 1:
    print("Yes")
    exit()


if k % n == 0 or k % m == 0:
    print("Yes")
    exit()
for p in range(n + 1):
    for q in range(m + 1):
        if p * (m - q) + q * (n - p) == k:
            print("Yes")
            exit()
print("No")

Solution (Python):
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)

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions

import copy





sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))




def main():
    n, m, k = ns()

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

    print("No")


if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]




n,m,k=mii()

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

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

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

if ans:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
sys.setrecursionlimit(100000000)
input = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

Solution (Python):
n, m, k = 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()
else:
    print('No')

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

Solution (Python):
N, M, K = map(int, input().split())
ret = False
for i in range(N+1):
    for j in range(M+1):
        r = j*N+i*M-2*i*j
        
        if r >= K:
            break
    if r == K:
        ret = True
        
        break
        
print('Yes' if ret else 'No')

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

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


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

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

ans='No'
i=0
while i<=N:
    j=0
    while j<=M:
        if M*i+N*j-2*i*j==K:
            ans='Yes'
        j+=1
    i+=1

print(ans)

Solution (Python):
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')
            exit()
print('No')

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

h, w, k= map(int, input().split())

if k%h==0 or k%w==0:
    print('Yes')
    exit()

for i in range(1,w):
    if w-i*2 != 0:
        if (k-i*h) % (w-i*2) == 0 and 0<(k-i*h) // (w-i*2)<=h:
            print('Yes')
            exit()

for i in range(1,h):
    if h-i*2 != 0:
        if (k-i*w) % (h-i*2) == 0 and 0<(k-i*w) // (h-i*2)<=w:
            print('Yes')
            exit()

print('No')

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

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

Solution (Python):
N, M, K = map(int, input().split())
answer = set()
for i in range(M+1):
    
    flipped = N*i
    for j in range(N+1):
        answer.add(flipped + ((M-i)-i)*j)

if K in answer:
    print('Yes')
else:
    print('No')

Solution (Python):
def main():
    N, M, K = (int(_) for _ in input().split())
    for a in range(N+1):
        for b in range(M+1):
            if b*(N-a)+a*(M-b) == K:
                print('Yes')
                break
        else:
            continue
        break
    else: print('No')
    return

if __name__ == '__main__':
    main()

Solution (Python):

import sys

def main():
    N, M, K = map(int, input().split())
    for i in range(N+1):
        a = K - i * M
        b = N - 2*i
        if b == 0:
            if K == i*M:
                print('Yes')
                exit()
        elif a % b == 0 and 0 <= a // b <= M:
            print('Yes')
            exit()
    print('No')
            

if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):

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


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


print('No')

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

Solution (Python):
n,m,k = [int(x) for x in 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)

Solution (Python):

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")

Solution (Python):
D = [int(_) for _ in input().split()]

def solve(D):
    N = D[0]
    M = D[1]
    K = D[2]
    
    for i in range(N+1):
        for j in range(M+1):
            if (i*(M-j) + (N-i)*j) == K:
                return "Yes"

    return "No"

print(solve(D))

Solution (Python):
n,m,k= input().split()

n = int(n)
m = int(m)
k = int(k)

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")

Solution (Python):
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")

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

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

Solution (Python):
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')

Solution (Python):

N, M, K = [int(s) for s in input().split()]

canDo = 'No'

for n in range(0, N + 1):
    for m in range(0, M + 1):
        if n * (M - m) + m * (N - n) == K:
            canDo = 'Yes'
            break

print(canDo)

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

k = 0
flag = False
for i in range(N+1):
  for j in range(M+1):
    k = (N-i) * j + (M-j) * i
    if k == K:
      flag = True
      break
  if flag:
    break

if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys
from sys import stdin

n, m, k = map(int, stdin.readline().rstrip().split())
ans = 0
for i in range(n+1):
    for j in range(m+1):
        if i * m + j * n - i * j * 2 == k:
            print("Yes")
            sys.exit()

print('No')

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


L=[0]*(10**7)
if K==0 or K==N*M:
    print("Yes")
else:
    for h in range(N+1):
        for w in range(M+1):
            now=h*w+(N-h)*(M-w)
            L[now]+=1
    if L[K]>0:
        print("Yes")
    else:
        print("No")

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,M,K=map(int,input().split())
    A=list(range(0,N*M+1,N))
    s=set()
    for i in range(M+1):
        for j in range(N+1):
            if A[i]+(M-i*2)*j==K:
                YesNo(1)
                exit()
    YesNo(0)


if __name__ == '__main__':
    main()

Solution (Python):




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


ans = 'No'
eflg = False
for i in range(n+1):
    for j in range(m+1):
        pt = i * (m - j) + j * (n - i)
        if pt == k:
            ans = 'Yes'
            eflg = True
            break
    if eflg:
        break


print(ans)

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

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

Solution (Python):
N,M,K=map(int,input().split())
a=0
for i in range(N+1):
    for j in range(M+1):
        if i*M+j*N-2*i*j==K:
            a=1
print(["No","Yes"][a])

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,m,k = na()

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

print('No')

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

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


if __name__ == '__main__':
    main()

Solution (Python):
n, m, k = map(int, input().split())
l = []
for i in range(n+1):
    for j in range(m+1):
        l.append(i*m + j*n -2*i*j)



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

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

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

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