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())
for p in range(0,n+1):
    for q in range(0,m+1):
        if k == m*p + n*q - 2*p*q:
            print("Yes")
            break
    else:
        continue
    break
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = False

for i in range(0,n+1):
    for j in range(0,m+1):
        black = i*(m-j) + j*(n-i)

        if black == k:
            flag = True


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,K=map(int,input().split());s=set();[s.add(j*(N-i)+i*(M-j)) for i in range(N+1) for j in range(M+1)];print("Yes" if K in s else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, K = list(map(int,input().strip().split(' ')))
import itertools
flg = 0
for i,j in itertools.product([k for k in range(N+1)],[k for k in range(M+1)]):
    kuro = M * i + N * j -2 * i * j
    if kuro == K:
        flg = 1
        break

if flg == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,M,K = inpl()

for x in range(N+1):
    for y in range(M+1):
        tmp = x*M+y*N-x*y*2
        if tmp == K:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

in_strings = lambda: stdin.readline()[:-1] # s = in_strings()
in_int = lambda: int(stdin.readline()) # N = in_int()
in_intlist = lambda: list(map(int, stdin.readline().split())) # List = in_intlist()

N, M, K = in_intlist()

for n in range(N+1):
    if n == N/2:
        continue
    if (K - M*n) / (N - 2*n) == (K - M*n) // (N - 2*n):
        if 0 <= (K - M*n) / (N - 2*n) <= M:
            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):
        if b * (N-a) + a * (M-b) == K:
            print('Yes')
            exit()


print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N,M,K):
  for a in xrange(N+1):
    for b in xrange(M+1):
      if a*b + (N-a)*(M-b) == K:
        return True
  return False
N,M,K = map(int,raw_input().split())
if solve(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):
    for j in range(M+1):
        if K == (N-i)*j + (M-j)*i:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
'''
黒マスの条件
行ボタン押 and (not 列ボタン押)
(not 行ボタン押） and 列ボタン押

行列の押したボタンは上左詰めできるので、
位置は関係がない
押したボタン数を考えたらよい

k, lを行、列ボタンの押下数とする
'''

N, M, K = map(int, input().split())
flg = False
for k in range( N+1):
    for l in range(M+1):
        if K == k * (M - l) + l * (N - k):
            flg = True
            break
print('Yes' if flg else '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(0)
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

P = []
for i in range(0,N+1):
    for j in range(0,M+1):
        p = (i*j) + ((N-i)*(M-j))
        P.append(p)
        
if K in P:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,m,k = list(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:
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")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def fLIP(N,M,K):
  for l in range(N+1):
    for k in range(M+1):
      P=l*(M-k)+k*(N-l)
      if P==K:
        return "Yes"
  return "No"

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

Submission status: Accepted

Solution code:
import sys


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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


if __name__ == '__main__':
    N, M, K = map(int, input().split())
    if check_flip(N, M, K):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

    editorial(N, M, K)

def editorial(N, M, K):
    for k in range(N+1):
        for l in range(M+1):
            # 黒の面積
            # 選択行数 * (列 - 選択列数)
            x = k * (M - l) + (N - k) * l
            if x == K:
                print("Yes")
                return

    print("No")

    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(N+1):
    for y in range(M+1):
        if M*x+N*y-2*x*y == K:
            print 'Yes'
            flag=1
            break
        else:
            continue
    if flag==1:
        break
if flag==0:
    print 'No'

Submission status: Accepted

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

flag = False

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

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

Submission status: Accepted

Solution code:
import numpy as np

N, M, K = (int(i) for i in input().split())
ans = False
for s in range(N + 1):
  for t in range(M + 1):
    if(s * M + t * N - s * t * 2 == K):
      ans = True
      break
  if(ans):
    break
if(ans):
  print("Yes")
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 + N*m - 2*n*m == K:
           print("Yes")
           exit()
print("No")

Submission status: Accepted

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

for r in range(N + 1):
    a = K - r * M
    b = N - 2 * r
    if b != 0 and a % b == 0 and 0 <= a // b <= M:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

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

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


print(main())

Submission status: Accepted

Solution code:
import sys
def calc(a,b,c,d):
    return a*b + c*d
N, M, K = map(int, sys.stdin.readline().strip().split())
if N*M / 2 < K:
    K = N*M -K
for n in xrange(N+1):
    for m in xrange(M+1):
        if calc(n,m,N-n,M-m) == K:
            print 'Yes'
            exit(0)
print 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def k_judge(n, m, k):
    for i in range(n+1):
        for j in range(m+1):
            if i*(m-j)+j*(n-i) == k:
                return True
    return False


def main():
    n, m, k = map(int, input().split())
    if k_judge(n, m, k):
        print("Yes")
    else:
        print("No")
        

if __name__ == "__main__":
    main()

Submission status: Accepted

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

from itertools import product

if __name__ == "__main__":
    N, M, K = map(int, raw_input().split())
    success = False
    for	n, m in	product(range(N+1), range(M+1)):
        if n*M + m*N - 2*n*m == K:
            success = True
            break
    if success:
        print "Yes"
    else:
        print "No"

Submission status: Accepted

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

Submission status: Accepted

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


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

print(solve(N, M, K))

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

flag = False

for i in range(n+1):
    for j in range(m+1):
        if (n - i) * (m - j) + i * j == k:
            flag = True
            break       
        else:
            continue
        break

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

Submission status: Accepted

Solution code:
N, M, k = tuple(int(i) for i in input().split(' '))
ans = 'No'
for a in range(N + 1):
    for b in range(M + 1):
        if M * a + N * b - 2 * a * b == 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*n-2*i*j==k:
			print("Yes")
			quit()
print("No")

Submission status: Accepted

Solution code:
def main():
    n, m, k = map(int, raw_input().split(" "))
    for i in range(0, n + 1):
        for j in range(0, m + 1):
            a = j
            b = i
            if b * m + a * n - 2 * a * b == k:
                return "Yes"
    return "No"

if __name__ == '__main__':
    m = main()
    print m

Submission status: Accepted

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

res = 'No'

for i in range(N+1):
    for j in range(M+1):
        if i*(M-j) + j*(N-i) == K:
            res = 'Yes'
            break

print(res)

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]

[n,m,k]=i2()
s="No"


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

Submission status: Accepted

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

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

    print("No")


solve()

Submission status: Accepted

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

if __name__=="__main__":
    solve()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N, M, K = map(int, raw_input().split() )
    ans = 0

    for a in xrange(N+1):
        for b in xrange(M+1):
            if (((N-a) * b + a * (M - b)) == K):
                ans = 1

    if ans == 1:
        print "Yes"
    else:
        print "No"

Submission status: Accepted

Solution code:
N,M,K = map(int,input().strip().split())
def judge(N,M,K):
    if K > N * M or K < 0:
        return False
    for n in range(0, N + 1):
        for m in range(0, M + 1):
            if n * M + m * N - 2*m * n == K:
                return True
    return False
if judge(N, M, K):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

for j in range(M+1):
 for i in range(N+1):
  if j*N+i*(M-2*j)==K or i*M+j*(N-2*i)==K:
    ok=1
 
if ok==0:
 print("No")
else:
 print("Yes")

Submission status: Accepted

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

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

       ok=1

if ok==0:
 print("No")
else:
 print("Yes")

Submission status: Accepted

Solution code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


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

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

    print('No')


main()

Submission status: Accepted

Solution code:
hoge = [int(x) for x in input().split()]
N = hoge[0]
M = hoge[1]
K = hoge[2]
frag = False
foo = []
tmp = 0
for i in range(N):
    tmp += M
    foo.append(tmp)
    if foo[-1] == K:
        frag = True
for i in range(len(foo)):
    for j in range(M):
        ii = i+1
        foo[i] -= ii
        foo[i] += (N-ii)
        if foo[i] == K:
            frag = True
            break

    if frag == True:
        break

if frag == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N,M,K=map(int,input().split())
isYes=False
for n in range(N+1):
    for m in range(M+1):
        if(N*m+M*n-2*n*m==K and not isYes):
            print('Yes')
            isYes=True
if(not isYes):
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
def calc(n, m, b_n, b_m):
	return m * b_n + n * b_m - b_n * b_m * 2

def sub():
	n, m, k = list(map(int, input().split()))
	for i1 in range(n + 1):
		for i2 in range(m + 1):
			if calc(n, m, i1, i2) == k:
				return "Yes"
	return "No"

def main():
	print(sub())

if __name__ == '__main__':
	main()

Submission status: Accepted

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

#N, Mの倍数ならできる
#N + M -2もできる
#l*k*(N - 1) + l*(M - k)もできる
#反転もできる
#よって、
b = int(N*M/2)
if N*M % 2 == 1:
    b += 1

al = set([])
for i in range(M + 1):
    for j in range(N + 1):
        a = i*(N - j) + j*(M - i)
        if a <= b:
            al.add(a)
            al.add(N*M - a)

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

Submission status: Accepted

Solution code:
def solution():
	n,m,k = map(int,input().split(' '))
	for i in range(0,m+1):
		for j in range(0,n+1):
			if i*n+j*m-2*i*j == k:
				return True

	return False



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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
n, m, k = map(int, input().split())
factor = []
factor.append(n*m)
#for tmp in range(min(n,m)):
#    sides = tmp+1
#    factor.append(sides**2+((n-sides)*(m-sides)))
factor.append((n//2)*(m//2)*2 + ((((n%2)*m+(m%2)*n)-1)//2 + 1))
for tmp in range(1,n+1):
    for tmp2 in range(1, m+1):
        factor.append(tmp*tmp2 + (n-tmp)*(m-tmp2))
factor = list(set(factor))
if k in factor or k%n == 0 or k%m == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N, M, K = list(map(int, input().split()))
if K > N * M // 2: K = N * M - K
can = {k * (N - l) + l * (M - k) for k in range(M//2 + 1) for l in range(N//2 + 1)}
print("Yes") if K in can else print("No")

Submission status: Accepted

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

print('Yes' if any(abs(a*m+b*n-2*a*b)==k for a,b in product(range(n+1),range(m+1))) else 'No')

Submission status: Accepted

Solution code:
from sys import stdin
ans = 'No'
n,m,k = map(int,stdin.readline().split())
for i in xrange(n+1):
    for j in xrange(m+1):
        if i*m - 2*j*i + j*n==k:
            ans = 'Yes'
print ans

Submission status: Accepted

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

for x in range(n + 1):
    for y in range(m + 1):
        if m * x + n * y - x * y * 2 == 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):
        b = i * M
        b -= i*j
        b += (N-i)*j
        if b == K:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

flag = 0
for i in range(n + 1):
    for j in range(m + 1):
        if(i * m - i * j + j * n - i * j == k):
            flag = 1
        if(n * m - (i * m - i * j + j * n - i * j) == k):
            flag = 1

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

Submission status: Accepted

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

def proc():
    count = 0
    m = 0

    data = [M*n for n in range(N)]
    for i in range(M):
        if K in data:
            return True
        data = [x + N - 2 * idx for idx, x in enumerate(data)]
    if K in data:
        return True
    return False

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())		# 5 7 2


ans='No'
for x in range(N+1):
	for y in range(M+1):
		if (N-x)*y + x*(M-y) == K:
			ans = 'Yes'
			break;

print(ans)

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):
        #  行選択n回,列選択m回
        black = n*M+m*N-n*m*2
        if black == K:
            print("Yes")
            ok = True
            break
    if ok:break
if ok == False:
    print("No")

Submission status: Accepted

Solution code:
h, w, k = map(int, raw_input().split())
for i in xrange(h+1):
    for j in xrange(w+1):
        if k == i * w + j * h - i * j * 2:
            print "Yes"
            quit()
print "No"

Submission status: Accepted

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

def f(N,M,K):
    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(f(N,M,K))

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

print('No')

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
def read_int_list():
    return list(int(i) for i in input().split())

n,m,k = read_int_list()

ans = "No"
flag = False
for i in range(0,n+1):
    for j in range(0,m+1):
        black = (i*m + j*n) - (i*j)*2
        if black == k:
            ans = "Yes"
            flag = True
            break
    if flag:
        break
print(ans)

Submission status: Accepted

Solution code:
inputs = input().split()
N = int(inputs[0])
M = int(inputs[1])
K = int(inputs[2])
a = [[0 for y in range(M)] for x in range(N)]

flag = False

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

if flag or (N == 1 and M == 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

f = False

for i in range(n//2+2):
    for j in range(m//2+2):
        t = i*j + (n-i)*(m-j)
        if ( t==k or n*m-t==k ):
            f = True
            break
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

tureList = []

for i in range(N+1):
	for j in range(M+1):
		tureList.append((i*M) + (j*N) - 2*(i*j))

if K in tureList:
	print("Yes")

else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

def foo():
	for x in range(0, N + 1):
		for y in range(0, M + 1):
			if M * x + N * y - 2 * x * y == K:
				print("Yes")
				return
	print("No")

foo()

Submission status: Accepted

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

from __future__ import division, print_function
import sys


def main():
    n, m, k = map(int, sys.stdin.readline().strip().split(" "))
    nums = {0}
    for i in range(0, n + 1):
        for j in range(0, m + 1):
            i_ = n - i
            nums.add(m * i + i_ * j - i * j)
    # print(nums)
    print("Yes" if k in nums else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    ans = "No"
    for kn in range(0, N + 1):
        for km in range(0, M + 1):
            # print(M * kn + N * km - (km * kn))
            if M * kn + N * km - 2 * (km * kn) == K:
                ans = "Yes"

    print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def get_blacks(n, m, N, M):
    return (n * m) + (N - n) * (M - m)

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

    found = False
    for n in range(N + 1):
        for m in range(M + 1):
            if (get_blacks(n, m, N, M) == K):
                print("Yes")
                return
    print("No")
    return


main()

Submission status: Accepted

Solution code:
#utf-8
# python3

n, m, k = (int(x) for x in input().split())

for a in range(m + 1):
    for b in range(n + 1):
        if (n * a + m * b - 2 * a * b == 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")
    
else:
    flag = False
    for n in range(1, N+1):
        if flag == True:
            break
            
        for m in range(1, M+1):
            if n*(M-m) + (N-n)*m == K:
                print("Yes")
                flag = True
                break
                
    
    if flag == False:
        print("No")