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());print("YNeos"[all(k*m-K+l*n-k*l*2for k in range(n+1)for l in range(m+1))::2])

Submission status: Accepted

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

Submission status: Accepted

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

#同じ行、列で2回押すのはノーカウントにできる
#行、列で押した回数を独立にできる
#nのうちp、mのうちq押す
#p*m+q*n-p*q
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")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
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')

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):
        if i*m+j*n-i*j*2==k:
            ans=1
            break
if ans==1:
    print("Yes")
else:
    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) + (N - k) * l == K:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# from bisect import bisect_left
# from heapq import heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np    # numpy.lcm()
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk
# import networkx as nx
# G = Graph()

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")
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
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)

Submission status: Accepted

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

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:
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
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")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 m * i + ( n - (2*i) ) * j == k:
            ans = 'Yes'
            break
print(ans)

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

print('No')

Submission status: Accepted

Solution code:
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)

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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 M*i + (N-i)*j -i*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:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
  #  print(i,j,a)
    if a==k:
      print("Yes")
      exit()
else:
  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):
        #print(n*j+m*i-i*j*2)
        if i*(m-j)+j*(n-i)==k:
            print('Yes');exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 k == (n*j + m*i) - 2*i*j:
            ok = True

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions

import copy

# import heapq
# from collections import deque
# import decimal

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


# ===CODE===

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

Submission status: Accepted

Solution code:
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')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
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")

Submission status: Accepted

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

Submission status: Accepted

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

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()
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
        # print(i,j,r)
        if r >= K:
            break
    if r == K:
        ret = True
        # print(i,j)
        break
        
print('Yes' if ret else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n,m,k=map(int,input().split())
#n:vertical
#m:horizontal
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')

Submission status: Accepted

Solution code:
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)

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*j+(N-i)*(M-j)==K:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
answer = set()
for i in range(M+1):
    # iは列で見たときの裏の数
    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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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()

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:
# -*- coding: utf-8 -*-
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

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

Submission status: Accepted

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

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

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:
# CODE FESTIVAL 2017 予選 A: B – fLIP
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()

Submission status: Accepted

Solution code:
# 2020/04/28
# CODE FESTIVAL 2017 qual - B

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

# Calc
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

# Output
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*(M-m) + (N-n)*m:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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