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:
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def perm(n,mod=None):
    ans = 1
    for i in range(1,n+1):
        ans *= i
        if mod!=None:
            ans %= mod
    return ans
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]

N,M,K = mint()
ans = False
for i in range(N+1):
    for j in range(M+1):
        if i*(M-j)+(N-i)*j==K:
            ans = True
            break
judge(ans)

Submission status: Accepted

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

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


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-2*i*j+j*n == 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:
import sys
import heapq


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

for k in range(N+1):
    for l in range(M+1):
        if k*(M-l) + l*(N-k) == K:
            print("Yes")
            exit(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):
        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())
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())
s = [[0 for i in range(n)]for j in range(m)]
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:
def main2():
    N, M, K = map(int, input().split())

    for i in range(N + 1):
        for j in range(M + 1):
            b = i * (M - j) + j * (N - i)

            if b == K:
                print("Yes")
                exit()

    print("No")

if __name__ == "__main__":
    main2()

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

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

Submission status: Accepted

Solution code:
from collections import deque
n, m, k = map(int, input().split())
ans = []
for i in range(0, n + 1):
    for j in range(0, m + 1):
        cnt = (i * m) + (j * n) - 2 * (i * j)
        # print(i, j, cnt)
        ans.append(cnt)
if k in ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, M, K = [int(x) for x in 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")
                return

    print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

# nは行で押したボタンの数、mは列で押したボタンの数。
for n in range(N+1):
    for m in range(M+1):
        if n * (M - m) + m * (N - n) == K:
            print("Yes")
            exit()
else:
    print("No")

Submission status: Accepted

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

# O(nm)

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

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

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





if __name__=="__main__":
    main()

Submission status: Accepted

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

def is_able(n, m, k):
    res = defaultdict(bool)
    res[0] = True
    for i in range(1, n+1):
        for j in range(1, m+1):
            count = 0
            count += i*j
            count += (n-i)*(m-j)
            res[count] = True
    return res[k]


if is_able(n, m, k):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
for i in range(N+1):
	# 現在i*Mだけ黒。1列ボタンを押すと黒はi消えN-i増える
	# あと求めたい黒の数
	a = K - i*M
	if a == 0:
		print("Yes")
		exit()
	# いま作成可能な1列あたりの黒
	b = N - 2*i
	if b != 0:
		if a%b == 0 and a*b > 0 and a//b < M:
			print("Yes")
			exit()
		
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M, K = MAP()

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

    print("Yes" if K in set(l) else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M, K = MAP()

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

if K in set(A):
    print('Yes')
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):
        if i * (m - j) + j * (n - i) == k:
            print('Yes')
            exit(0)
print(('No'))

Submission status: Accepted

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

p = False
for ni in range(m+1):
    for mi in range(n+1):
        if k == ni*n + mi*m - 2*(ni*mi):
            p = True
            break

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

Submission status: Accepted

Solution code:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    #n = int(stdin.readline().rstrip())
    n,m,k = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    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")



if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n,m,k=map(int,input().split())
flg=0
for i in range(n):
  tmp=k-m*i
  if n==i*2 or tmp<0:
    pass
  elif tmp%(n-i*2)==0 and 0<=tmp//(n-i*2)<=m:
    flg=1
if flg==1:
  print('Yes')
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):
    if i*m+j*n-2*i*j==k:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Submission status: Accepted

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

    print('No')
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):
        now = M * i
        now -= j * i
        now += j * (N - i)
        if now == K:
            ok = True
if ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

N, M, K = map(int, input().split())
ok = False
for i in range(N + 1):
    # now = M * i
    for j in range(M + 1):
        now = i * (M - j) + (N - i) * j
        if now == K:
            ok = True
        # now -= j * i
        # now += j * (N - i)
        # if now == K:
        #     ok = True
if ok:
    print("Yes")
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):
        black = i * m - (j * i) + (n - i) * j
        if black == k:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if k==0:
    print("Yes")
    sys.exit()

for i in range(n+1):
    black=i*m
    c=n-(2*i)
    for j in range(m+1):
        if black+(j*c)==k:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

Solution code:
n,m,k = map(int,input().split())
for i in range(0,n+1):
    for j in range(0,m+1):
        if (i*m + j*n) - (i*j)*2 == k:
            print("Yes")
            exit()
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 N*M - i*j - (N - i)*(M - j) == K:
            ok = True
if ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M, K = LI()

    ans = 'No'
    for i, j in itertools.product(range(N + 1), range(M + 1)):
        if i * j + (N - i) * (M - j) == K:
            ans = 'Yes'
            break

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,m,k=map(int,input().split())
k=(m*n)-(k*2)
l=[]
for i in range(m+1):
    for j in range(n+1):
        if (m-2*i)*(n-2*j)==k:
            print('Yes')
            exit()
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):
    if i*M + j*N - 2*i*j == K:
      flag = True
    
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    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


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
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())

# 約数生成
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)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n+1):
    for j in range(m+1):
        if i*(m-j)+(n-i)*j == k:
            print('Yes')
            sys.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):
        cnt=i*j+(N-i)*(M-j)
        if cnt==K:
            ans="Yes"
            break

print(ans)

Submission status: Accepted

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

for j in range(M + 1):
    for i in range(N + 1):
        t = i * j + (N - i) * (M - j)
        area = M * N - t
        # area = (M - j) * i + (N - i) * j
        if area == K:
            flag = True

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

Submission status: Accepted

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

for j in range(M + 1):
    for i in range(N + 1):
        # t = i * j + (N - i) * (M - j)
        # area = M * N - t
        area = (M - j) * i + (N - i) * j
        if area == K:
            flag = True

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

Submission status: Accepted

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

    for i in range(0, N+1):
        for j in range(0, M+1):

            if i*(M-j) + j*(N-i) == K:
                print("Yes")
                return

    print("No")

solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
N,M,K = map(int,input().split())
list = [0 for i in range(N*M+1)]
i = 0
while i <= M:
    k=0
    list[N*i]=1
    while k < N:
        list[N*i+(M-2*i)*k]=1
        k+=1
    i+=1
j = 0
while j <= N:
    l = 0
    list[M*j]=1
    while l < M:
        list[M*j+(N-2*j)*l]=1
        l+=1
    j+=1
if list[K] ==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for x in range(N+1):
    for y in range(M+1):
        F|=(x*(M-y)+y*(N-x)==K)

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

Submission status: Accepted

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

for row in range(N+1):
    for colum in range(M+1):
        black = row * M
        black -= row * colum
        black += (N - row) * colum
        if black == 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):
  if (2*i-n)==0:
    if k==m*n//2:
      ans="Yes"
  else:
    if (k-n*m+m*i)%(2*i-n)==0 and 0<=(k-n*m+m*i)//(2*i-n)<=m:
      ans="Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M, K = mapint()
s = set()
for i in range(N+1):
    for j in range(M+1):
        s.add(i*M+j*N-i*j*2)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[7]:


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


# In[9]:


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


# In[ ]:

Submission status: Accepted

Solution code:
import sys
N, M, K = list(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:
import sys
input = sys.stdin.readline

N,M,K=list(map(int,input().split()))
for iN in range(N+1):
    for iM in range(M+1):
        tmp = (N-iN)*(iM)+(iN)*(M-iM)
        if tmp == K:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
ROW, COL, K = map(int, input().split())
for row in range(ROW + 1):
    for col in range(COL + 1):
        if row * (COL - col) + col * (ROW - row) == K:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

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

s = set()
for i in range(n + 1):
    for j in range(m + 1):
        t = i * (m - j) + j * (n - i)
        if t <= n * m:
            s.add(t)
if k in s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, m, k = map(int, readline().split())

    for row in range(n + 1):
        for col in range(m + 1):
            count = n * m - (row * col) - ((n - row) * (m - col))
            if count == k:
                return print("Yes")

    print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if K% N==0 or K%M==0:
    print('Yes')
else:
    answers=[]
    for n in range(1,N+1):
        for m in range(1,M+1):
            answer=0
            answer+=n*M+m*N-n*m*2
            answers.append(answer)
    for n in range(1,M+1):
        for m in range(1,N+1):
            answer=0
            answer+=n*N+m*M-n*m*2
            answers.append(answer)
    if K in answers:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

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

print('Yes' if isok else 'No')

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    N, M, K = [int(item) for item in input().split()]
    
    is_found = False
    for i in range(N+1):
        for j in range(M+1):
            if i*M + j*N -2*j*i == K:
                is_found = True
                break
    print('Yes') if is_found else print('No')

if __name__ == "__main__":
    resolve()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-26 12:46:01 +0900
# LastModified: 2020-07-26 13:19:34 +0900
#


import os
import sys


def main():
    n, m, k = map(int, input().split())
    for s in range(m+1):
        for t in range(n+1):
            if k == n*s+m*t-2*s*t:
                print("Yes")
                return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

def main():
    n, m, k = map(int, input().split())
    cnt = set()
    for x in range(n+1):
        for y in range(m+1):
            tmp = x*y + (n-x)*(m-y)
            if tmp not in cnt:
                cnt.add(tmp)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#CODE FESTIVAL 2017 qual A
"""
やるか・やらないかだけで、結果的にできるものは同じ。順序に関係はない。
縦・横にいくつ使うかを全探索で求まった。
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

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

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

print("No")

Submission status: Accepted

Solution code:
import sys

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

# 組み合わせは関係ないため、全探索可能
for i in range(N+1):
    tmp = i * M
    for j in range(M+1):
        tmp += (N - 2 * i)
        if tmp == 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):
        count = i*M+j*N-2*i*j
        if count == K:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys

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

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

#+++++

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

	
	
#+++++
isTest=False

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

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

Submission status: Accepted

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