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: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,m,k = na()

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

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m, k = map(int, input().split())
l = []
for i in range(1,n+1):
    for j in range(1,m+1):
        l.append(i*m + j*n -2*i*j)

# print(l)

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

Submission status: Wrong Answer

Solution code:
m, n, k = map(int, input().split())
l = []
for i in range(1,n+1):
    for j in range(1,n+1):
        l.append(i*m + j*n -2*i*j)

# print(l)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
for x in range(n+m+1):
    for a in range(min(n+1,x+1)):
        if 0<=x-a<=m:
            num=a*m+(x-a)*(n-2*a)
            if k==num:
                print("Yes")
                print(a,x-a)
                exit()
print("No")

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = False
for n in range(0, N + 1):
    for m in range(0, M + 1):
        res = n * N + m * M - 2 * n * m
        if res == K:
            ans = True
            break

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

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

success = False
for x in range(M):
    for y in range(N):
        temp = (M - x) * y + (N - y) * x
        if temp == K:
            success = True

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

Submission status: Wrong Answer

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

def sea():
    for i in range(N+1):
        for j in range(M+1):
            if N*i+M*j-2*i*j == K:
                return 'Yes'
    return 'No'

print(sea())

Submission status: Wrong Answer

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

def sea():
    for i in range(N):
        for j in range(M):
            if N*i+M*j-2*i*j == K:
                return 'Yes'
    return 'No'

print(sea())

Submission status: Wrong Answer

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

def sea():
    for i in range(K):
        for j in range(K):
            if N*i+M*j-2*i*j == K:
                return 'Yes'
    return 'No'

print(sea())

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve():
    H,W,K = map(int,input().split())

    for k in range(1,H+1):
        for l in range(1,W+1):
            if k*(W-l)+l*(H-k) == K:
                print('Yes')
                return
    else:
        print('No')
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    for n in range(N + 1):
        for m in range(M + 1):
            overlap = 2 * max(n, m) if n > 0 and m > 0 else 0
            cnt = n * M + m * N - overlap
            if cnt == K:
                print("Yes")
                return
    else:
        print("No")
        return


main()

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heappush, heappop, heappushpop, heapify, heapreplace
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

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

#ここから書き始める
n, m, k = map(int, input().split())
# print(-(-(n + m) // 2))
yes1 = (k % n == 0)
yes2 = (k % m == 0)
yes3 = (k == -(-(n * m) // 2))
yes4 = (k == (n * m) // 2)
if yes1 or yes2 or yes3 or yes4:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heappush, heappop, heappushpop, heapify, heapreplace
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

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

#ここから書き始める
n, m, k = map(int, input().split())
if k % n == 0 or k % m == 0 or k == -(-(n * m) // 2) or k == (n + m) // 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heappush, heappop, heappushpop, heapify, heapreplace
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

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

#ここから書き始める
n, m, k = map(int, input().split())
# print(-(-(n + m) // 2))
if k % n == 0 or k % m == 0 or k == -(-(n * m) // 2) or k == (n + m) // 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heappush, heappop, heappushpop, heapify, heapreplace
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

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

#ここから書き始める
n, m, k = map(int, input().split())
# print(-(-(n + m) // 2))
if k % n == 0 or k % m == 0 or k == -(-(n * m) // 2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

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

print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

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

print("No")

Submission status: Wrong Answer

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

ans = "No"
for i in range(N):
  for j in range(M):
    n_black = i*(M-j) + (N-i)*j
    if n_black == K:
      ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Wrong Answer

Solution code:
def main():
    width, height, target = map(int, input().split())
    answer = False
    for i in range(height):
        if answer:
            break
        for j in range(width):
            if (width - j) * (height - i) + i * j == target:
                answer = True
                break
    print("Yes" if answer else "No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

for i in range(1,N+1):
    for j in range(1,M+1):
        black= (N-i)*j + (M-j)*i
        if K==black:
            flag=True
            break
    if flag:
        break
       
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(N):
    for j in range(M):
        black= (N-i)*j + (M-j)*i
        if K==black:
            flag=True
            break
    if flag:
        break
       
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for r in range(n+1):
    for  c in range(m+1):
        if k == c*(m-r) + r*(n-c):
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

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

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()

Submission status: Wrong Answer

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

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()

Submission status: Wrong Answer

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

for h in range(n):
    for w in range(m):
        black=m*h+n*w-2*h*w
        if black==k:
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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'
      break
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

bo = False
for  i in range(0,n):
    for j in range(0,m):
        if i*(m-j) + j*(n-i) == k:
            bo = True

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

Submission status: Wrong Answer

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

bo = False
for  i in range(1,n+1):
    for j in range(1,m+1):
        if i*(m-j) + j*(n-i) == k:
            bo = True

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

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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
    if black == k:
      print("Yes")
      exit()
print("No")

Submission status: Wrong Answer

Solution code:
n,m,k=map(int,input().split())
for i in range(n):
    for j in range(m):
        if k==i*(m-j)+j*(n-i):
            print('Yes')
            exit()
print('No')
#解説参照済み

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, m, k = na()
dp = [[0] * (m+1) for _ in range(n+1)]

for ni in range(n):
    for mi in range(m):
        r = ni + mi
        s = ni * m + mi * n - (0+ni-1)*(ni)//2 - (0+mi-1)*(mi)//2
        if k == s:
            print("Yes")
            quit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cant = True
for i in range(n+1):
    for j in range(m+1):
        if n*i+m*j-2*i*j==k: cant = False
print("YNeos"[cant::2])

Submission status: Wrong Answer

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

cant = True
for i in range(1, n+1):
    for j in range(1, m+1):
        if n*i+m*j-2*i*j==k: cant = False
print("YNeos"[cant::2])

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N, M, K = map(int, input().split())
    possible = False
    for i in range(N + 1):
        for j in range(M + 1):
            black = (N - i) * M + N * (M - j)
            if black == K:
                print("Yes")
                possible = True
                break
        if possible: break
    else: print("No")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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

n, m, k = [int(x) for x in input().split()]
for i in range(0, m + 1):
    for j in range(0, n + 1):
        c = i * (m - j) + j * (n - i)
        if c == k:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m,K = map(int,input().split())
ans = "No"

for k in range(1,n+1):
    for l in range(1,m+1):
        if k*(m-l)+(n-k)*l == K: 
            ans = "Yes"  
            break

print(ans)

Submission status: Wrong Answer

Solution code:
n,m,K = map(int,input().split())
ans = "No"

for k in range(n):
    for l in range(m):
        if k*(m-l)+(n-k)*l == K: 
            ans = "Yes"  
            break

print(ans)

Submission status: Wrong Answer

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

if K % N == 0 or K % M == 0 or K % (N + M) == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
n,m,k = [int(x) for x in stdin.readline().rstrip().split()]
if k > n+m:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

board = np.array([[1 for j in range(m)] for i in range(n)])
ans = set()

for i in range(n):
    board[i] *= -1
    for j in range(m):
        board[:, j] *= -1
        ans.add(np.count_nonzero(board == -1))

if k in ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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 - i*j
        if a == k:
            print("Yes")
            exit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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