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())
l = []
for i in range(n+1):
    for j in range(m+1):
        l.append(i*m + j*n -2*i*j)

# print(l)

if k in l:
    print("Yes")
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 m*i + n*j - 2*(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):
        x=i*m+j*n-2*(i*j)
        if k==x:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
def check():
    for i in range(M):
        P = M-2*i
        K1 = K - i*N
        if P==0:
            if K1 == 0:
                return True
            return False
        if K1%P==0 and K1//P<=N and K1//P>=0:
            return True
    return False
if check():
    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, radians
from itertools import accumulate, permutations, combinations, 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
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

H, W, K = MAP()

for x in range(H+1):
	y = (K-x*W)/(H-2*x) if H !=2*x else (H*W-K)/H
	if y.is_integer() and 0 <= y <= W:
		print("Yes")
		break
else:
	print("No")

Submission status: Accepted

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

if k>n*m:
    print('No')
    exit()
    
if k%n==0 or k%m==0:
    print('Yes')
    exit()
k=min(m*n-k,k)
for i in range(1,n):
    for j in range(1,m):
        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())

ans = False
for n in range(0, N + 1):
    for m in range(0, M + 1):
        res = m * N + n * M - 2 * n * m
        if res == K:
            ans = True
            break

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

Submission status: Accepted

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


def solve():
    if K == 0:
        return True
    if K % M == 0:
        return True
    if K % N == 0:
        return True

    for cr in range(N + 1):
        for cc in range(M + 1):
            count = cr * M + cc * N
            if cc > 0:
                count -= cc * cr
            if cr > 0:
                count -= cc * cr
            if count == K:
                return True
            # print(cr, cc, count)
    
    return False

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

Submission status: Accepted

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

for i in range(n+1):
    for g in range(m+1):
        if i*g+(n-i)*(m-g)==k:
            print("Yes")
            exit()
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):
        if(x*M+y*N-2*x*y==K):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

    print(main())



resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

success = False
for x in range(M + 1):
    for y in range(N + 1):
        temp = (M - x) * y + (N - y) * x
        if temp == K:
            success = True

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

Submission status: Accepted

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

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

print(sea())

Submission status: Accepted

Solution code:
def solve():
    H,W,K = map(int,input().split())

    for k in range(0,H+1):
        for l in range(0,W+1):
            if k*(W-l)+l*(H-k) == K:
                print('Yes')
                return
    else:
        print('No')
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n,m,k=map(int,input().split())
n,m=min(n,m),max(n,m)
for i in range(n//2+n%2):
  num,dem=k-i*m,n-2*i
  if num%dem or not(0<=num//dem<=m):continue
  print("Yes");exit()
print("No")

Submission status: Accepted

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

    for n in range(N + 1):
        for m in range(M + 1):
            overlap = 2 * n * m
            cnt = n * M + m * N - overlap
            if cnt == K:
                print("Yes")
                return
    else:
        print("No")
        return


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):#黒くした列の数
        #print(i,j,(m*i)+((n-i)*j)-(i*j))
        if (m*i)+((n-i)*j-(i*j))==k:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
import sys
from heapq import heappush, heappop, heappushpop, heapify, heapreplace
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

#ここから書き始める
n, m, k = map(int, input().split())
yes = False
for i in range(n + 1):
    for j in range(m + 1):
        if i * (m - j) + j * (n - i) == k:
            yes = True
            break
    if yes:
        break
if yes:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
H, W, K = map(int, input().split())
for n in range(W+1):
    if W == n+n:
        continue
    l = (K-H*n)//(W-2*n)
    if 0 <= l <= H and H*n+(W-2*n)*l == K:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

ANS = [0] * (n*m + 1)

for i in range(n+1):
    for j in range(m+1):
        ANS[i*j + (n-i)*(m-j)] = 1
# print(ANS)
if ANS[k] == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

ans = False
for n in range(N + 1):
    if 2 * n == N:
        if M * n == K:
            ans = True
            break
    else:
        num = M * n - K
        denom = 2 * n - N
        if num % denom == 0 and 0 <= num // denom <= M:
            ans = True
            break
print('Yes' if ans else '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):
        tmp = i * (m - j) + (n - i) * j
        if tmp == k:
            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-i)*j+(M-j)*i==K:
            flag=1
            break
if flag==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

ans = False
for n in range(N + 1):
    for m in range(M + 1):
        if n * (M - m) + m * (N - n) == K:
            ans = True
            break
    else:
        continue
    break
print('Yes' if ans else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, m, k = map(int, input().split())
eq_k = False
for p in range(n+1):
  for q in range(m+1):
    area = p * (m - q) + q * (n - p)
    #print(p, q, area)
    if area == k:
      eq_k = True
      break
  if eq_k: break
if eq_k:
  print('Yes')
else:
  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):
    n_black = i*(M-j) + (N-i)*j
    if n_black == 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 i==0 or j==0:
            x=N*j+M*i
            if x==K:
                print("Yes")
                exit()
        x=N*j+M*i-(i*j)-i*j
        #print(str(i)+" "+str(j))
        #print(x)
        if x==K:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

judge = [False]*(n*m+1)

for i in range(n+1):
  for j in range(m+1):
    judge[n*j+m*i-i*j*2] = True
if judge[k]:
  print("Yes")
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(0)
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):
        black = i*(m-j) + j*(n-i)
        if black == k:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
ans = "No"
for h in range(0, N+1, 1):
    for w in range(0, M+1, 1):
        tmp = h * M + w * N - 2*h*w
        if tmp == K:
            ans = "Yes"
            print(ans)
            exit()
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    width, height, target = map(int, input().split())
    answer = False
    if target == 0:
        answer = True
    else:
        for i in range(height):
            if answer:
                break
            for j in range(width):
                if (width - j) * (height - i) + i * j == target:
                    answer = True
                    break
    print("Yes" if answer else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, m, k = map(int, input().split())
l = lambda a, b: a * m + b * n - 2 * a * b
for n_ in range(n+1):
    for m_ in range(m+1):
        if l(n_, m_) == k:
            print("Yes")
            exit()
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 - 2*n*m == K:
      print('Yes')
      exit()
else:
  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):
        cnt = (n - i) * j + (m - j) * i
        if cnt == k:
            ans = "Yes"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for r in range(n+1):
    for  c in range(m+1):
        if k == c*(n-r) + r*(m-c):
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

n,m,k = map(int,input().split())
#１回押すと変わるマス　= N * M -1
#２回目押すと黒に変わるマス N * M -1 -2
# 3 = N * M -1 -4

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

Submission status: Accepted

Solution code:
import sys
n, m, k = [int(i) for i in sys.stdin.readline().split()]
flg = False
for y in range(n + 1):
    for x in range(m + 1):
        if y * (m - x) + x * (n - y) == k:
            flg = True
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
#  1回押すと変わるマス = N * M - 1
# 2回目押すと黒になるマス = N * M - 1 - 2
# 3 = N * M - 1 - 4
cnt = 0
for i in range(N + 1) :
    for j in range(M + 1) :
        cnt = i * M + j * N - 2 * i * j
        if cnt == K :
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
  n, m, k = input_list()
  for x in range(n+1):
    for y in range(m+1):
      a = x*(m-y) + y*(n-x)
      if a == k:
        print('Yes')
        exit()
  print('No')
  
def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()

Submission status: Accepted

Solution code:
# coding: utf-8
(n,m,k) = map(int, input().rstrip().split(" "))

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,K=map(int,input().split())
ret = 'No'
for m in range(M+1):
  a=K-m*N
  b=M-2*m
  if 0<=a and 0<b and a%b==0:
    n=a//b
    if 0<=n<=N:
      ret = 'Yes'
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

bo = False
for  i in range(0,n+1):
    for j in range(0,m+1):
        if i*(m-j) + j*(n-i) == k:
            bo = True

if bo :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for i in range(0,N+1):
    for j in range(0,M+1):
        ans = i*M+j*N-i*j*2
        if ans==K:
            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*n-2*i*j==k:
            ans="Yes"
            break
    if 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):
    black = i*m + j*n - i*j*2
    #print(i,j,black)
    if black == 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')
      exit()
print('No')

Submission status: Accepted

Solution code:
N,M,K=map(int, input().split())
print("YNeos"[not any(K==i*j+(N-i)*(M-j) for i in range(N+1) for j in range(M+1))::2])

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

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

n, m, k = na()
for r in range(n+1):
    for c in range(m+1):
        s = n*m - r*c - (n-r)*(m-c)
        if k == s:
            print("Yes")
            quit()
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*n-2*i*j==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 k==i*(m-j)+j*(n-i):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_b
# B - fLIP

# ボタンを押す順番と最後のマスの結果は関係ない
# あるボタンを2回押すと0回押した状態になる
# どの行、列のボタンを押しても黒マスの数は同じ
# 行のボタン、列のボタンを何回押したか見る

# 行のボタンをr回、列のボタンをc回押したとき、黒マスの数は
# r*M + c*N - 2*r*c


# N,M <= 1000 だし全探索

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

can = False


def func(r, c):
    return r * m + c * n - 2 * r * c


for r in range(n + 1):
    for c in range(m + 1):
        can |= func(r, c) == k

print("Yes" if can else "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):
        black = i * (M - j) + j * (N - i) 
        
        if black == 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):
        black=i*m+j*n-2*i*j
        if black==k:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
import fractions
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def getyaku(n):
    res = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            res.append(i)
            res.append(n // i)

    return(sorted(list(set(res))))

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 main():
    n,m, k = getlist()
    for i in range(n+1):
        tmp = m*i
        for j in range(m + 1):
            ttmp = tmp + n * j
            ttmp -= i*j*2
            if ttmp == k:
                # print(i, j)
                print("Yes")
                return
    print("No")
    return

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Submission status: Accepted

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

cant = True
for i in range(n+1):
    for j in range(m+1):
        if m*i+n*j-2*i*j==k: cant = False
print("YNeos"[cant::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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(0)
print("No")

Submission status: Accepted

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

flag = False
for i in range(N+1):
    for j in range(M+1):
        cnt = 0

        cnt += i * M
        cnt += j * N
        cnt -= (i*j)*2

        if cnt == K:
            flag = True
            break
    if flag:
        break

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
is_k = False
for k in range(N+1):
    for l in range(M+1):
        c = k*(M-l)+l*(N-k)
        if c==K:
            is_k = True

if is_k:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
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 fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,M,K=MI()
    for i in range(N+1):
        for j in range(M+1):
            if i*(M-j)+j*(N-i)==K:
                print("Yes")
                return
    print("No")
    
    

if __name__ == '__main__':
    main()

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*l + (M-l)*(N-k) == K:
            print("Yes")
            exit(0)
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N, M, K = map(int, input().split())
    possible = False
    for i in range(N + 1):
        for j in range(M + 1):
            black = (N - i) * j + i * (M - j)
            if black == K:
                print("Yes")
                possible = True
                break
        if possible: break
    else: print("No")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

n, m, k = [int(x) for x in input().split()]
for i in range(0, m + 1):
    for j in range(0, n + 1):
        c = i * (n - j) + j * (m - i)
        if c == k:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

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

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 - 2*i*j == k:
            print('Yes')
            exit()
print('No')

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)+(n-k)*l == K: 
            ans = "Yes"  
            break

print(ans)

Submission status: Accepted

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

for k in range(0,n+1):
    for l in range(0,m+1):
        if k*(m-l)+(n-k)*l == K: 
            ans = "Yes"  
            break

print(ans)

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 == (N - n) * m + (M - m) * n:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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