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 copy
import sys
from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, M, K] = [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
    mas_num = N*M
    ok_set = set([])
    for i in range(M + 1):
        ok_set.add(i * N)
        ok_set.add(mas_num - (i * N))

    for i in range(N + 1):
        ok_set.add(i * M)
        ok_set.add(mas_num - (i * M))

    ok_set.add(mas_num/2)

    ok_set.add((mas_num/2) + (mas_num%2))

    if K in ok_set:
        print "Yes"
    else:
        print "No"



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

b=int(n/2)+1
c=int(m/2)+1
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 k in x:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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


def run():
    if is_0() or is_all():
        result_ok()
        return 0
    if is_duble():
        result_ok()
        return 0
    if is_M_ok() or is_N_ok():
        result_ok()
        return 0
    if is_ok():
        result_ok()
        return 0
    result_no()


def is_0():
    return K == 0


def is_all():
    return K == N * M


def is_duble():
    return K % N == 0 or K % M == 0


def is_N_ok():
    if N % 2 == 0:
        return K == N * M / 2
    else:
        a = N * M / 2
        return K >= a and K <= a + M


def is_M_ok():
    if M % 2 == 0:
        return K == N * M / 2
    else:
        a = N * M / 2
        return K >= a and K <= a + N


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


def result_ok():
    print("Yes")


def result_no():
    print("No")


if __name__ == '__main__':
    run()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(100000):
    
    if K == N*M:
        print("Yes")
        break
    
    cnt *= 2
    if cnt == K:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(100000):
    cnt *= 2
    if cnt == K:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

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):
            print('Yes')
            isYes=True
if(not isYes):
    print('No')

Submission status: Wrong Answer

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

	return False



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

Submission status: Wrong Answer

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

for i in range(100000):
    cnt *= 2
    if cnt == K:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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


def run():
    if is_0() or is_all():
        result_ok()
        return 0
    if is_duble():
        result_ok()
        return 0
    if is_M_ok() or is_N_ok():
        result_ok()
        return 0
    result_no()


def is_0():
    return K == 0


def is_all():
    return K == N * M


def is_duble():
    return K % N == 0 or K % M == 0


def is_N_ok():
    if N % 2 == 0:
        return K == N * M / 2
    else:
        a = N * M / 2
        return K >= a and K <= a + M


def is_M_ok():
    if M % 2 == 0:
        return K == N * M / 2
    else:
        a = N * M / 2
        return K >= a and K <= a + N


def result_ok():
    print("Yes")


def result_no():
    print("No")


if __name__ == '__main__':
    run()

Submission status: Wrong Answer

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

x=N*M-2*K

if x==0:
    print('Yes')
else:
    for d in range(1,abs(x)+1):
        if x%d==0 and (d<M and abs(x//d)<M and (N-d)%2==0 and (M-x//d)%2==0):
            print('Yes')
            break
    else:
        print('No')

Submission status: Wrong Answer

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

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

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

    else:
        print('No')


main()

Submission status: Wrong Answer

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

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


def run():
    if is_0() or is_all():
        result_ok()
        return 0
    if is_duble():
        result_ok()
        return 0
    if is_ok():
        result_ok()
        return 0
    result_no()


def is_0():
    return K == 0


def is_all():
    return K == N * M


def is_duble():
    return K % N == 0 or K % M == 0


def is_ok():
    if N % 2 == 0:
        return K == N * M / 2
    else:
        a = N * M / 2
        return K >= a and K <= a + M


def result_ok():
    print("Yes")


def result_no():
    print("No")


if __name__ == '__main__':
    run()

Submission status: Wrong Answer

Solution code:
input= input().split()
n = int(input[0])
m = int(input[1])
k = int(input[2])
N = m * n - k * 2 
s = 0;

for i in range(n + 1):
    x = i * 2 - m
    for j in range(m + 1):
        y = j * 2 - n
        if x * y == N:
            print('Yes')
            s = 1;
            break
    if s == 1:
        break

if s == 0:
    print('No')

Submission status: Wrong Answer

Solution code:
value = input().split()
value = [int(x) for x in value]
slice_value = value[:2]
slice_value.sort()

if slice_value[0] * slice_value[1] < value[2]:
    print("No")
elif value[2] % slice_value[0] == 0 or value[2] % slice_value[1] == 0:
    print("Yes")
elif value[2] < slice_value[0]*2 or value[2] > slice_value[1]*2:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
sys.setrecursionlimit(10 ** 9)

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


def read():
    H, W, d = ILI()
    return H, W, d


def solve(H, W, d):
    ans = [[None] * W for __ in range(H)]
    color = ["R", "Y", "G", "B"]
    count = [[set(color)] * W for __ in range(H)]
    ans[0][0] = "R"
    count[0][0] = set()
    for i in range(-d, d + 1):
        j, ano_j = (d - abs(i), -(d - abs(i)))
        try:
            count[0 + i][0 + j] - set("R")
        except:
            pass
    for i in count:
        print(i)



def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

	return False



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

Submission status: Wrong Answer

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 - j*i + j*n==k:
            ans = 'Yes'
print ans

Submission status: Wrong Answer

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))
if k in factor or k%n == 0 or k%m == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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 - j*i + j*n==k or j*n + j*i - i*m==k:
            ans = 'Yes'
print ans

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())
#    N,K,M = 100,200,543

    tile = np.zeros((N,M),dtype=bool)
    
    if( K <= N*M):
        for j in range(M):
            tile[:,j] = True
            tilesum = np.sum(tile)
    
            if tilesum==K:
                answer = True
            elif tilesum>K:
                tile[:,j] = False
                break
        
        for i in range(N-1,0,-1):
            tile[i] = np.logical_not(tile[i])
            tilesum = np.sum(tile)
            
            if tilesum==K:
                answer = True
                break
            elif tilesum > K:
                break

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

Submission status: Wrong Answer

Solution code:
n,m,k = map(int,input().split())
arr = [[] for _ in range(n)]
ans = []
flg = True
for i in range(n):
    for j in range(m):
        arr[i].append(0)

def check(a,b=[]):
    b = []
    for i in range(len(a)):
        b.extend(a[i])
    num = b.count(1)
    return num

for i in range(n):
    for j in range(m):
        arr[i][j] += 1
        if arr[i][j] >= 2:
            arr[i][j] = 0
    num = check(arr)
    ans.append(num)

for j in range(m):
    for i in range(n):
        arr[i][j] += 1
        if arr[i][j] >= 2:
            arr[i][j] = 0
    num = check(arr)
    ans.append(num)

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

Submission status: Wrong Answer

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

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

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

    else:
        print('No')


main()

Submission status: Wrong Answer

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))
if k in factor:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())
#    N,K,M = 100,200,543

    tile = np.zeros((N,M),dtype=bool)
    
    if( K <= N*M):
        for j in range(M):
            tile[:,j] = True
            tilesum = np.sum(tile)
    
            if tilesum==K:
                answer = True
            elif tilesum>K:
                tile[:,j] = False
                break
        
        for i in range(N):
            tile[i] = np.logical_not(tile[i])
            tilesum = np.sum(tile)
            
            if tilesum==K:
                answer = True
                break
            elif tilesum > K:
                break

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

Submission status: Wrong Answer

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

for x in range(n + 1):
    for y in range(m + 1):
        if n * x + m * y - x * y * 2 == k:
            print("Yes")
            sys.exit()
print("No")

Submission status: Wrong Answer

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

for j in range(M):
 for i in range(N):
  if j*N+i*(M-2*j)==K or i*M+j*(N-2*i)==K:
#   if j*N+i*(M-j)==K or i*M+j*(N-i)==K:
       ok=1
  else:
    for mm in range(i):
#      print(i,j)
#      print(i*M+j*(N-2*i)+mm*(j-i))
      if i*M+j*(N-i)+mm*(j-i)==K:
        ok=1

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

Submission status: Wrong Answer

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 - j*n==k or j*n-i*m==k:
   ans = 'Yes'
print ans

Submission status: Wrong Answer

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 * n - i * j + j * m - i * j == k):
            flag = 1
            break
        if(n * m - (i * n - i * j + j * m - i * j) == k):
            flag = 1
            break

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

Submission status: Wrong Answer

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 - j*n==k:
   ans = 'Yes'
print ans

Submission status: Wrong Answer

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

ok = False
for n in range(N):
    for m in range(M):
        #  行選択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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, M, K = map(int, input().split())                                                                                                                           
                                                                                                                                                              
def proc():                                                                                                                                                   
    count = 0                                                                                                                                                 
    m = 0                                                                                                                                                     
    for i in range(N):                                                                                                                                        
        if count < K:                                                                                                                                         
            count += M                                                                                                                                        
            m += 1                                                                                                                                            
        if count == K:                                                                                                                                        
            return True                                                                                                                                       
    for j in range(M):                                                                                                                                        
        count += N - 2 * m                                                                                                                                    
        if count == K:                                                                                                                                        
            return True                                                                                                                                       
    return False                                                                                                                                              
                                                                                                                                                              
print('Yes' if proc() else 'No')

Submission status: Wrong Answer

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:
            print "Yes"
            quit()
print "No"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def II(): return int(input())
def ILI(): return list(map(int, input().split()))


def read():
    N, M, K = ILI()
    return N, M, K


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


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())

    tile = np.zeros((N,M),dtype=bool)
    
    if( K <= N*M):       
        for j in range(M):
            tile[:,j] = True
    
            if np.sum(tile)==K:
                answer = True
            elif(np.sum(tile)>K):
                tile[:,j] = False
                break
        
        for i in range(N):
            tile[i] = np.logical_not(tile[i])
            
            if np.sum(tile)==K:
                answer = True
                break
            elif np.sum(tile) > K:
                break

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())

    tile = np.zeros((N,M),dtype=bool)
    
    if( K > N*M):
        print("No")
        
    for j in range(M):
        tile[:,j] = True

        if np.sum(tile)==K:
            answer = True
        elif(np.sum(tile)>K):
            tile[:,j] = False
            break
    
    for i in range(N):
        tile[i] = np.logical_not(tile[i])
        
        if np.sum(tile)==K:
            answer = True
            break
        elif np.sum(tile) > K:
            break

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

Submission status: Wrong Answer

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

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

main()

Submission status: Wrong Answer

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

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

main()

Submission status: Wrong Answer

Solution code:
N, M, K = [int(i) for i in input().split()]
total = 0
for i in range(2):
    if i != 0:
        N,M = M,N
    for n in range(N):
        total = n*N
        for m in range(M):
            total += M - 2*n
            if total == K:
                break
        if total == K:
            break
    if total == K:
        break
if total == K:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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(1,n+1):
    for j in range(1,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: Wrong Answer

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 * n - i * j + j * m - i * j == k):
            flag = 1
            break
        if(n * m - i * n - i * j + j * m - i * j == k):
            flag = 1
            break

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())

    tile = np.zeros((N,M),dtype=bool)
    
    if( K > N*M):
        print("No")
        
    for j in range(M):
        tile[:,j] = True

        if np.sum(tile)==K:
            answer = True
        elif(np.sum(tile)>K):
            tile[:,j] = False
            break
    
    for i in range(N):
        tile[i] = np.logical_not(tile[i])
        
        if np.sum(tile)==K:
            answer = True
            break

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

Submission status: Wrong Answer

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):
    for j in range(M):
        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: Wrong Answer

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):
		for i2 in range(m):
			if calc(n, m, i1 + 1, i2 + 1) == k:
				return "Yes"
	return "No"

def main():
	print(sub())

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())

    tile = np.zeros((N,M),dtype=bool)
    
    if( K > N*M):
        print("No")
        
    for j in range(M):
        for i in range(N):
            tile[i,j] = True

        if np.sum(tile)==K:
            answer = True
    
        if (np.sum(tile)>K):
            for i in range(N):
                tile[i,j] = False
            break
    
    for i in range(N):
        tile[i] = np.logical_not(tile[i])
        
        if np.sum(tile)==K:
            answer = True
            break

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

Submission status: Wrong Answer

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

f = False

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

Submission status: Wrong Answer

Solution code:
N, M, K = [int(i) for i in input().split()]
total = 0
for n in range(N):
    total = n*N
    for m in range(M):
        total += M - 2*n
        if total == K:
            break
    if total == K:
        break
if total == K:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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 * n - i * j + j * m - i * j == k):
            flag = 1
            break

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

Submission status: Wrong Answer

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):
    for j in range(M):
        if M*i + N*j - (j)*(i)*2 == K:
            flag = True

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

Submission status: Wrong Answer

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

f = False

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

Submission status: Wrong Answer

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

for j in range(M+2):
 for i in range(N+2):
  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: Wrong Answer

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): 
        print(i * n - i * j + j * m - i * j)
        if(i * n - i * j + j * m - i * j == k):
            flag = 1

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

Submission status: Wrong Answer

Solution code:
N,M,K= (int(i) for i in input().split())  
ok=0
#if K%N==0 or K%M==0 :
# print("Yes")
#else:
for j in range(M):
 for i in range(N):
  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: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017

@author: thvinmei
"""

import numpy as np

if __name__ == '__main__':
    answer = False
    N,M,K=map(int,input().split())

    tile = np.zeros((N,M))
    
    if( K > N*M):
        print("No")
        
    for j in range(M):
        for i in range(N):
            tile[i,j] = 1

        if np.sum(tile)==K:
            answer = True
    
        if (np.sum(tile)>K):
            for i in range(N):
                tile[i,j] = 0
            break
    
    for i in range(N):
        for j in range(M):
            if tile[i,j] == 0:
                tile[i,j] = 1
            else:
                tile[i,j] = 0
        
        if np.sum(tile)==K:
            answer = True
            break

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

Submission status: Wrong Answer

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

flag = False
for n in range(M + 1):
    for m in range(N + 1):
        print(n * N + m * (M - n * 2), n, m)
        # if n * N + m * (M - n) == K:
        if n * N + m * (M - n * 2) == K:
            flag = True

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

Submission status: Wrong Answer

Solution code:
print("YES")

Submission status: Wrong Answer

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(1, n + 1):
        for j in range(1, 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: Wrong Answer

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 = set()
    for i in range(1, n + 1):
        for j in range(1, 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: 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")
elif K >= min(N, M) and K < (N + M):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

	return False



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

Submission status: Wrong Answer

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 == 1 or j == 1) and i * N + j * M - i * j == K:
            print('Yes')
            sys.exit()

        if (i != 1 and j != 1) and i * N + j * M - 2 * i * j == K:
            print('Yes')
            sys.exit()

print('No')

Submission status: Wrong Answer

Solution code:
hoge = [int(x) for x in input().split()]
frag = False
k = 0
for i in range(hoge[0]):
    k += hoge[1]
    if k == hoge[2]:
        frag = True
    elif k > hoge[2]:
        break
i += 1
if frag == False and i > hoge[0]/2:
    for j in range(hoge[1]):
        tmp = abs(hoge[0] - i*2)
        k -= tmp
        if k == hoge[2]:
            frag = True
        elif k <= hoge[2]:
            break
if frag == True:
    print("Yes")
else:
    print("No")