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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin
n,m,k = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = set()

for i in range(m+1):
    cnt = i * n
    rev = m - i
    for j in range(n+1):
        ans.add(cnt + (rev - i) * j)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,K = map(int,input().split())
ans = 'No'
for n in range(N+1):
    for m in range(M+1):
        tmp = ((N-n)*m + (M-m)*n)
        if tmp==K:
            ans = 'Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for a in range(n):
	if n-2*a == 0:
		continue
	b = ((k-a*m))/(n-2*a)
	if (b >= 0) and (b <= m) and (b%1 == 0):
		print("Yes")
		sys.exit()

print("No")

Submission status: Accepted

Solution code:
def main():
    N, M, K = (int(i) for i in input().split())
    ans = set()
    for i in range(M+1):
        for j in range(N+1):
            if N-j >= 0 and M-i >= 0:
                ans.add((N-j)*i + (M-i)*j)
    if K in ans:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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):
        l = i*(m-j) + (n-i)*j
        if k==l:
            ans ="Yes"
        else:
            continue
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def black(x,y):
  return x*y+(n-x)*(m-y)

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

Submission status: Accepted

Solution code:
N,M,K = map(int,input().split())
ans = 'No'
for x in range(M+1):
    if M-2*x == 0:
        if K%N == 0:
            ans = 'Yes'
            break
        else:
            continue
    else:
        if (K-N*x)%(M-2*x) == 0 and 0 <= (K-N*x)/(M-2*x) <= N:
            ans = 'Yes'
            break
        else:
            continue
print(ans)

Submission status: Accepted

Solution code:
N,M,K = map(int,input().split())
ans = 'No'
flag = False
for x in range(M+1):
    if flag:
        break
    for y in range(N+1):
        if (N-y)*x+(M-x)*y == K:
            ans = 'Yes'
            flag = True
            break
print(ans)

Submission status: Accepted

Solution code:
import math
import bisect
import collections
import itertools
import heapq
import sys
sys.setrecursionlimit(10**9)
def gcd(a,b):return math.gcd #最大公約数
def lcm(a,b):return (a*b) // math.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i: divisors.append(n//i)
    return divisors
def is_prime(n):
    if n == 1: return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0: return False 
    return True
def primes(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n + 1, i): is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
def sieve_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N,M,K = imn()

for i in range(N+1):
    for j in range(M+1):
        b_cnt = (i*M)+(j*N)-(2*i*j)
        if b_cnt == K:
            print('Yes')
            break
    else:
        continue
    break
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")
      exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

able_set = set()
for ni in range(n+1):
  base = ni * m
  for mi in range(m+1):
    black = base - ni*mi + (n-ni)*mi    
    able_set.add(black)    
    
if k in able_set:
  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 j*n+i*m-2*i*j==k:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
# 横の回数をx, 縦の回数をyとすると k=x*(M-2)+y*(N-2)になればいい
# あとは例外 N or M==1のときはK<=N*Mからすべての値が可能
# N or M==2のときはすべての偶数が可能
# KがNorMで割り切れれば可能
# しょうがくせいのさんすうなのにあたまがわるすぎてくそどはまりしたよ せかいいちきょうぷろむいてないね いんたいしたほうがいいよ

n, m, k = map(int, input().split())
if n == 1 or m == 1:
    print("Yes")
    exit()
if (n == 2 or m == 2) and k % 2 == 0:
    print("Yes")
    exit()
if k % n == 0 or k % m == 0:
    print("Yes")
    exit()
for y in range(1, n):
    for x in range(1, m):
        # print("y, x = {}, {}".format(y, x))
        # print("面積 {}".format((y * m - x * y) + x * (n - y)))
        if k == (y * m - x * y) + x * (n - y):
            # print(y, x)
            # print("y*x={}".format(y * x))
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
import sys

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

"""

それぞれA,B回押すとすると
A*(N-B) + B*(M-A) == K

AはM以下
.##
.##
#..
#..

"""

for A in range(M+1):

    for B in range(N+1):

        if A*(N-B) + B*(M-A) == 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*j+(n-i)*(m-j)==k:
      print("Yes")
      exit(0)
else:
  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):
        black = N*j + M*i - i*j*2
        if K == black:
            flag = True
            break

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

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 i * m + j * n - i * j * 2 == k:
            f = True
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for i in range(N+1):
    for j in range(M+1):
        if i*(M-j)+j*(N-i) == K:
            ans = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, M, K = map(int, input().split())
dp = [[0] * (M + 1) for _ in range(N + 1)]
for i in range(N + 1):
  for j in range(M + 1):
    dp[i][j] = i * M + j * N - 2 * i * j
    if dp[i][j] == K:
      print("Yes")
      exit(0)
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):
            if i*M + j*N - 2*min(i, j)*max(i, j) == K:
                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)+j*(n-i) == k:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N, M, K = rl()

bool = [False] * (N * M + 1)
for i in range(N+1):
    bool[i*M] = True
    for j in range(1, M+1):
        x = N - (2 * i)
        if 0 <= i*M + x*j <= N * M:
            bool[i*M + x*j] = True

print('Yes' if bool[K] else 'No')
# 47

Submission status: Accepted

Solution code:
N,M,K = map(int,input().split())
flag = 0
if (N*M)%2==0 and K==(N*M)//2:
    flag = 1
else:
    y = 0
    while y<=N:
        if N-2*y!=0 and (K-M*y)%(N-2*y)==0 and M>=(K-M*y)//(N-2*y)>=0:
            flag = 1
            break
        y += 1
if flag==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 and j:
            ans = i * m + j * n - (i * j * 2)
        elif i > 0 and j == 0:
            ans = i * m
        elif i == 0 and j > 0:
            ans = j * n
        else:
            ans = 0
        if ans == k:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def nm(n, m, k):
    for i in range(n+1):
        for j in range(m+1):
            black = (n - i) * j + (m - j) * i
            if black == k:
                return "Yes"
    return "No"


if __name__ == "__main__":
    n, m, k = map(int, input().split())
    ans = nm(n, m, k)
    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*n-2*i*j:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

Solution code:
def examB():
    N, M, K = LI()
    ans = "No"
    for i in range(N+1):
        for j in range(M+1):
            cur = M*i + N*j - i*j*2
#            print(i,j,cur)
            if cur==K:
                ans = "Yes"
                break
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Submission status: Accepted

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

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

print('No')

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

Submission status: Accepted

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

if K % M == 0 or K % N == 0:
    print('Yes')
    exit()

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

ok = False
for n in range(N+1):
    for m in range(M+1):
        if n*m + (N-n)*(M-m) == K:
            ok = True

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

Submission status: Accepted

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,M,K = map(int,input().split())
ans = False
for p in range(N+1):
    for q in range(M+1):
        if p*M+q*N - 2*p*q == K:
            ans = True
if ans:print("Yes")
else:print("No")

Submission status: Accepted

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

flg=False
for x in range(N+1):
    for y in range(M+1):
        temp = (N-x)*(M-y) + (x*y)
        if K==temp:
            flg=True
            break
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M,K=map(int,input().split())
l=[i*j+(N-i)*(M-j) for i in range(N+1) for j in range(M+1)]
print('Yes' if K in l else '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*m-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(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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    n, m, k = map(int, input().split())

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
n,m,k=[int(i) for i in input().split()]
def main():
    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")
main()

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())  # N行, M列, K個黒くしたい

flag = False

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

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

Submission status: Accepted

Solution code:
#総当たりできる
n,m,k = map(int, input().split( ))

ans = set()
for i in range(n+1):
    for j in range(m+1):
        ans.add(i*j+(n-i)*(m-j))###
if k in ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W, K = map(int, input().split())
Upper = H//2 if H % 2 == 0 else H//2+1
for h in range(Upper):
    w = (K-W*h)/(H-2*h)
    if int(w) == w and 0 <= w <= W:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W, K = map(int, input().split())
for h in range(H+1):
    for w in range(W+1):
        if (W-w)*h+(H-h)*w == 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())
set_num = set([])
for n_i in range(n + 1):
    for m_i in range(m + 1):
        set_num.add((n_i * m) + (m_i * n) - ((n_i * m_i) * 2))
if k in set_num:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for n in range(0,N+1):
    for m in range(0,M+1):
        a=n*M+m*N-n*m*2
        if a not in lst:
            lst.add(a)
print("Yes" if K in lst else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m, k = list(map(int, input().split()))
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())
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())
# aN + bM - ab =　K となるA,Bが存在するか。

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

Submission status: Accepted

Solution code:
n,m,b = map(int,input().split())
for i in range(n+1):
  for j in range(m+1):
    tmp = i * m + j * n - i * j * 2
    if tmp == 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)+j*(n-i)==k:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
from sys import stdin
N,M,K = [int(x) for x in stdin.readline().rstrip().split()]
flag = False
for a in range(N+1):
    for b in range(M+1):
        if (N-a)*b + (M-b)*a == K:
            flag = True
if flag:
    print("Yes")
else:
    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):
        if b*n+a*m-2*a*b==k:
            print('Yes')
            break
    else:
        continue
    break
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 k==i*j+(n-i)*(m-j):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
def resolve():
    n, m, k = map(int, input().split())
    for l in range(n + 1):
        for r in range(m + 1):
            black = l * m + r * n - 2 * r * l
            if black == k:
                print("Yes")
                return 0
    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 m*i + n*j - i*j*2 == k:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,m,k = inpl()
bla = 0
for i in range(n+1):
    bla = i*m
    for j in range(m+1):
        if bla + (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 * j + (n-i) * (m-j) == k:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

for y in range(N+1):
    for t in range(M+1):
        if t*(N-y)+y*(M-t)==K:
            print "Yes"
            quit()
else:
    print "No"

Submission status: Accepted

Solution code:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

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

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

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

Submission status: Accepted

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

canMake = set()
for i in range(N + 1):
    for j in range(M + 1):
        area = (N - i) * (M - j) + i * j
        canMake.add(area)

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

Submission status: Accepted

Solution code:
X, Y, K = map(int, input().split())

for Xi in range(0, X+1):
    for Yi in range(0, Y+1):
        if Yi * (X-Xi) + Xi * (Y-Yi) == K:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

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

Submission status: Accepted

Solution code:
n,m,k = map(int,input().split())
a = set()
for i in range(n+1):
  for j in range(m+1):
    a.add(m*i+n*j-i*j*2)
print('YNeos'[k not in a::2])

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import permutations
from sys import exit, stdin
N, M, K = [int(_) for _ in stdin.readline().rstrip().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')