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:
def solve(n, m, k):
    for i in range(n + 1):
        for j in range(m + 1):
            if i * j + (n - i) * (m - j) == k:
                return 'Yes'
    return 'No'


print(solve(*map(int, input().split())))

Submission status: Accepted

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


for n in range(N + 1):
    if N == 2*n : 
        if K == N*M / 2 : OK = True
    else :     
        flag =  (K - M * n) % (N - 2*n) == 0
        if(flag):
            m = (K - M * n) / (N - 2*n)
            if( (m >= 0) & (m <= M) ) : 
                OK = True
            
if(OK) : print("Yes")
else : print("No")

Submission status: Accepted

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

def search(n, m, k):
    flag = False
    for n_rows in range(n+1):
        if flag:
            break
        for n_cols in range(m+1):
            blacks = n_rows * m + n_cols * n - 2*n_rows * n_cols
            if blacks == k:
                flag = True
                break
    return flag
if search(n, m, k):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
nmk = input().split()
n = int(nmk[0])
m = int(nmk[1])
k = int(nmk[2])

message = "No"
for i in range(m):
    x = int(i)
    if m-2*x == 0:
        y=-1
    else:
        y = (-n*x+k)/(m-2*x)
#         print(y)
    if y >= 0 and y <= n and y%1 == 0:
        message="Yes"
        break

print(message)

Submission status: Accepted

Solution code:
n, m, k = [int(c) for c in input().split(' ')]
possible = 0
for x in range(m+1):
    for y in range(n+1):
        if n*x - y*x + y*(m-x) == k:
            possible = 1
print("Yes" if possible else 'No')

Submission status: Accepted

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

anss = []
for i in range(n+1):
    for j in range(m+1):
        ans = n*j + m*i -i*j*2
        anss.append(ans)

if k in anss: 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 N*j + M*i - 2*i*j == K:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
yes = "Yes"
no = "No"

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

ans = no
for y in range(N+1):
    for x in range(M+1):
        if N*M - (N-y) * (M-x) - x*y == K:
            ans = yes
            break
print(ans)

Submission status: Accepted

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

for n in xrange(N+1):
  for m in xrange(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())
def solve():
    for i in range(N+1):
        for j in range(M+1):
            a = i*(M-j) + j*(N-i)
            if a == K:
                return True
    return False

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

Submission status: Accepted

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


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


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

Submission status: Accepted

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

def f():
    for i in range(N+1):
        for j in range(M+1):

            nn = j
            mm = i
            if mm*M + nn*N - 2 * mm*nn == K:
                return "Yes"
    return "No"

print f()

Submission status: Accepted

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

nmk = raw_input()
nmk = nmk.split()
n,m,k = map(int,nmk)

status = 0

for i in range(m+1):
    for j in range(n+1):
        if n*i + m*j - 2*i*j == k:
            status = 1
            break

if status == 0:
    print "No"
else:
    print "Yes"

Submission status: Accepted

Solution code:
from math import *


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

if __name__ == '__main__':
        main()

Submission status: Accepted

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

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

Submission status: Accepted

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

a=input().split()
n=int(a[0])
m=int(a[1])
k=int(a[2])
f(n,m,k)

Submission status: Accepted

Solution code:
def func() :
    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')
                return
    print('No')
func()

Submission status: Accepted

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

res = False

for n in range(N):
    t1 = K - n * M
    t2 = N - 2 * n
    if t2 == 0:
        if n * M == K:
            res = True
        continue
    if t1 % t2 != 0:
        continue
    m = t1 // t2
    if 0 <= m and m <= M:
        res = True

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, M, K = tuple(map(int, input().split()))

list_ = [M*n for n in range(N+1)]
uni = set()

for n, l in enumerate(list_):
    uni.update([(l - n*m + (N-n)*m) for m in range(M+1)])

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

Submission status: Accepted

Solution code:
[N,M,K]= map(int, raw_input().split())
ans=["No","Yes"]
f=0
for m in range(M+1):
    for n in range(N+1):
        if K== m*N+n*M-2*m*n:
            f=1
print ans[f]

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

        else:
            n = (K + N * m - N * M) / d
            if n - int(n) == 0 and n >= 0 and n <= N:
                return "Yes"
    return "No"

print(main())

Submission status: Accepted

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

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

print("No")
exit(0)

Submission status: Accepted

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

    for i in xrange(N + 1):
        cur = M*i
        if cur > K: break
        for j in xrange(M + 1):
            if cur - i*j + (N - i)*j == K:
                return True
    for i in xrange(M + 1):
        cur = N*i
        if cur > K: break
        for j in xrange(N + 1):
            if cur - i*j + (M - i)*j == K:
                return True

    return False

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, K = map(int, input().split())
for r in range(N + 1):
    black = r * M
    b_c, w_c = r, N - r
    for c in range(M + 1):
        if black - b_c * c + w_c * c == K:
            print("Yes")
            quit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import heapq
import math
import sys

tmp = input()
N, M, K = [int(a) for a in tmp.split()]

for i in range(N+1):
    for j in range(M+1):
        val = i * (M - j) + j * (N - i)
        if val > K:
            break
        if val == K:
            print('Yes')
            sys.exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import socket

if socket.gethostname() == 'N551J':
    sys.stdin = open('b1.in')


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


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


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


def read_str():
    return input()


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


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
for h in range(0, H+1):
  for w in range(0, W+1):
    if h*W + w*H - h*w == K:
      print('Yes')
      exit()
print('No')

Submission status: Runtime Error

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 == 0:
            print('Yes')
            sys.exit()
print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
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)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N,M,K = IL()
for a in range(N+1):
  for b in range(M+1):
    if (A*(M-B)+B*(N-A))==K:
      print("Yes")
      exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m,k = map(int, input().split())
ans = "No"
if k%(m-1)==0 and k//(m-1) > 1:
  if k//(m-1) <= n: ans = "Yes"
if k%(n-1)== 0 and k//(n-1) > 1:
  if k//(n-1) <= m: ans = "Yes"
print(ans)

Submission status: Runtime Error

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

for i in range(n):

    if (n-2*i) != 0 and (k-m*i) % (n-2*i) == 0:
        j = (k - m * i) // (n - 2 * i)
        if w*i + (n-2*i)*j == k:
            print('Yes')
            exit()
print('No')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

h, w, k= map(int, input().split())


if k%h==0 or k%w==0:
    print('Yes')
    exit()

if w!=2:
    for i in range(1,w):
        if (k-i*h) % (w-i*2) == 0 and 0<(k-i*h) // (w-i*2)<=h:
            print('Yes')
            exit()

if h!=2:
    for i in range(1,h):
        if (k-i*w) % (h-i*2) == 0 and 0<(k-i*w) // (h-i*2)<=h:
            print('Yes')
            exit()

print('No')

Submission status: Runtime Error

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

n = int(n)
m = int(m)
k = int(k)

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


print("No")

Submission status: Runtime Error

Solution code:
N,M,K=map(int, input().split())
#最初しろ
#行、列ごとに反転
L=[0]*(10*7)
if K==0 or K==N*M:
    print("Yes")
else:
    for h in range(N):
        for w in range(M):
            now=h*w+(N-h)*(M-w)
            L[now]+=1
    if L[K]>0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,M,K=map(int,input().split())
    A=list(range(0,N*M+1,N))
    s=set()
    for i in range(N+1):
        for j in range(M+1):
            if A[i]+(M-i*2)*j==K:
                YesNo(1)
                exit()
    YesNo(0)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, M, K = map(int, input().split())
print("Yes" if (N+M)%K == 0 else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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 == 1 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: Runtime Error

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//2+1):
    w = (K-W*h)/(H-2*h)
    if int(w) == w and 0 <= w <= W:
        print("Yes")
        exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m,k=map(int,input().split())
if n%k==0 or m%k==0:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
N,M,K=map(int,input().split())
ans="No"
for x in range(N+1):
  a=K-x*M
  b=N-2*x
  if x!=0 and a%b==0 and 0<=a//b<M:
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

Solution code:
N,M,K=map(int,input().split())
ans="No"
for x in range(N+1):
  a=K-x*M
  b=N-2*x
  if a!=0 and a%b==0 and 0<=a//b<M:
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

Solution code:
N,M,K = map(int, input().split())
field = [[0]*M for i in range(N)]
def reverse(x):
    if x == 0:
        return 1
    else:
        return 0
now = 0
for i in range(N+1):
    if (K - now) % (N - 2 * i) == 0 and (K - now) / (N - 2 * i) <= M and  (K - now) / (N - 2 * i) >= 0:
        print("Yes")
        exit(0)
    elif i == N:
        break
    else:
        for j in range(M):
            field[i][j] = reverse(field[i][j])
            now = sum(map(sum,field))

print("No")

Submission status: Runtime Error

Solution code:
N,M,K = map(int, input().split())
field = [[0]*M for i in range(N)]
def reverse(x):
    if x == 0:
        return 1
    else:
        return 0
now = 0
for i in range(N+1):
    if (K - now) % (N - 2 * i) == 0 and (K - now) / (N - 2 * i) <= N and  (K - now) / (N - 2 * i) >= 0:
        print("Yes")
        exit(0)
    elif i == N:
        break
    else:
        for j in range(M):
            field[i][j] = reverse(field[i][j])
            now = sum(map(sum,field))

print("No")

Submission status: Runtime Error

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

for i in range(m+1):
  if k - n*i == 0 or (k - n*i > 0 and (k - n*i) % (m - 2*i) == 0):
    print('Yes')
    exit()
  elif k - n*i < 0:
    print('No')
    exit()
print('No')

Submission status: Runtime Error

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

for i in range(m+1):
  if k - n*i < 0:
    print('No')
    exit()
  if (k - n*i) % (m - 2*i) == 0:
    print('Yes')
    exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import deque

N, M, K = map(int, input().split())
r_c = deque([(0, 0)])

r = 0
c = 0
sum = 0
for i in range(1000010):
	if (sum > 10000*K):
		print('No')
		exit()
	sum = i*N
	if (K-sum%(M-N-r+c) == 0):
		print('Yes')
		exit()

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
ab = [list(map(int, input().split())) for x in range(n)]

cnt = 0
for a, b in reversed(ab):
    diff = a - b + cnt
    if diff == -b:
        pass
    elif diff < 0:
        cnt -= diff
    else:
        diffb = diff % b
        if diffb:
            cnt += b - diffb
print(int(cnt))

Submission status: Runtime Error

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

for i in range(M):
    for j in range(N):
        mass[i].append(0)

if K == (N * M):
    print("Yes")
elif K % N == 0 or K % M == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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 - m * n == K or:
                return True
    return False
if judge(N, M, K):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

print('No')

Submission status: Runtime Error

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

print('No')

Submission status: Runtime Error

Solution code:
# coding:utf-8

import numpy as np

all=int(input())
all_list=all.split(" ")
n=all_list[0]
m=all_list[1]
k=all_list[2]

for i_n in range(n):
        for i_m in range(m):
                now_k=(i_n*m+i_m*n)-2*i_n*i_m
                if k==now_k:
                        print("Yes")
print("No")

Submission status: Runtime Error

Solution code:
def flip(N, M, K, Mnum, Nnum, black):
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum, Nnum+1, black+N-(Mnum*2)) or flip(N, M, K, Mnum+1, Nnum, black+M-(Nnum*2))

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
s=input().split()
import numpy as np
a=np.zeros((int(s[0]),int(s[1])))

b=int(int(s[0])/2)
c=int(int(s[1])/2)
x=[]
for i in range(b):
    a[i,:]=1
    x.append(np.count_nonzero(a))
for j in range(c):
    a[:,j]=1-i
    x.append(np.count_nonzero(a))
if int(s[2]) in x:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
# coding:utf-8

import numpy as np

n=int(input())
m=int(input())
k=int(input())

for i_n in range(n):
        for i_m in range(m):
                now_k=(i_n*m+i_m*n)-2*i_n*i_m
                if k==now_k:
                        print("Yes")
print("No")

Submission status: Runtime Error

Solution code:
# coding:utf-8

import numpy as np

n=int(input())
m=int(input())
k=int(input())

sum_set=set()

for i_n in range(n):
        for i_m in range(m):
                sum_set.add((i_n*m+i_m*n)-2*i_n*i_m)

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

Submission status: Runtime Error

Solution code:
def flip(N, M, K, Mnum, Nnum, black):
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum)

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
def flip(N, M, K, Mnum, Nnum, black):
    print('count: ', Mnum+Nnum)
    print(black)
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum)

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')