Problem:


Score : 100 points

Problem Statement

In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?

Constraints

2 ≤ n, m ≤ 100

Input

Input is given from Standard Input in the following format:

n m

Output

Print the number of blocks in K-city.

Sample Input 1

3 4

Sample Output 1

6

There are six blocks, as shown below:

Sample Input 2

2 2

Sample Output 2

1

There are one block, as shown below:



Sample input:
3 4


Sample output:
6

Submission status: Runtime Error

Solution code:
n,m =map(int(),imput().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m =map(int(),imput().split)
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    h,w = i_map()
    n = i_input()

    a = i_list()
    ans = []
    for m,i in enumerate(a):
        ans.extend([str(m+1)]*i)
    ans = list(ans)
    for i in range(1,h+1):
        if i%2 == 0:
            print(" ".join(ans[w*(i-1):w*(i-1)+w]))
        else:
            print(" ".join(ans[w*(i-1):w*(i-1)+w][::-1]))

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
n, m = map(int,input.split)
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
aaa

Submission status: Runtime Error

Solution code:
n, m = = map(int, input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n = int(input())
print(2 * n,end = "\n")

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
x=0
y=0
c=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
    elif(l[i]%2==0):
        y+=1
    else:
        c+=1
if(n%2==0):
    if(x>=c):
        print("Yes")
    else:
        print('No')
else:
    if(x>=(c-1)):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
##
N = int(input())
N_List = list(map(int,input().split()))
Four_List = [i for i in N_List if i % 4 == 0]
Two_List = [i for i in N_List if i % 2 == 0]
if len(Two_List)-len(Four_List) > 0:
    N = N - (len(Two_List) - len(Four_List)) + 1

if N // 2 <= len(Four_List):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
##
N = int(input())
N_List = list(map(int,input().split()))
Four_List = [i for i in N_List if i % 4 == 0]
Two_List = [i for i in N_List if i % 2 == 0]
if len(Two_List) > 0:
    N = N - (len(Two_List) - len(Four_List)) + 1

if N // 2 <= len(Four_List):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
  if A[i]%2 != 0:
    lll.append(A[i])
four = len(l)
two = four - len(ll)
zero = N-two
a = math.floor(N/2)
b = A.count(0)

if zero <= four and b == 0:
  print("Yes")
elif zero-two <= four:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout


def main():
    line = stdin.readline()
    parts = line.split()
    n = int(parts[1])
    m = int(parts[2])
    stdout.write(str((n-1)*(m-1)))


main()

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
def main():
    line = stdin.readLine()
    parts = line.split()
    a = int(parts[1])
    b = int(parts[2])
    stdout.write((a-1)*(b-1))
main()

Submission status: Runtime Error

Solution code:
from sys import stdin,stdout

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    b=int(parts[1])
    stdout.write(a-1*b-1)
main()

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout


def main():
    line = stdin.readLine()

    parts = line.split()
    n = int(parts[1]) #n
    m = int(parts[2]) #m
    stdout.write(str((n-1)*(m-1)))


main()

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
def main():
    line = stdin.readLine()
    parts = line.split()
    a = int(parts[1])
    b = int(parts[2])
    stdout.write(a*b)
main()

Submission status: Runtime Error

Solution code:
def main():
    ans=n-1*m-1
    print(ans)   


main()

Submission status: Runtime Error

Solution code:
x,y = input().split()
a = x-1
b = y-1
print(a*b)

Submission status: Runtime Error

Solution code:
x,y = input().split()
print((x-1)*(y-1))

Submission status: Runtime Error

Solution code:
x, y = int(input().split())
a = x-1
b = y-1
print(a*b)

Submission status: Runtime Error

Solution code:
x,y = int(input().split)
print((x-1)*(y-1))

Submission status: Runtime Error

Solution code:
print((int(input())-1)*(int(input())-1))

Submission status: Runtime Error

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

print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n, m = map(int, input())
ans = (n-1)*(m-1)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))

x2=0
x4=0
x1=0
for x in a:
  if x%2==0:
    x2+=1
  if x%4==0:
    x4+=1
  if x%2==1:
    x1+=1
    
if x4+x1==n:
  if x4>=x1-1:
    print('Yes')
  else:
    print('No')
  
else:
  if x4>=x1:
    print('Yes')
  else:
    
    print('No')

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
print(n*m-2(n+m)+4)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split(" ''))
print((a-1) * (b-1))

Submission status: Runtime Error

Solution code:
n,m = int(input().split())
k = (n-1)*(m-1)
print(k)

Submission status: Runtime Error

Solution code:
n, m = map(int, input.split())
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n, m = map(int, input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
a, b = list(map(int, input()))

print((a - 1) * (b - 1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input.split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n=int(input())
m=int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m=map(intput().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m=int(intput().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n=int(input())
m=int(input())
print((n-1) * (m-1))

Submission status: Runtime Error

Solution code:
n, m =int(input())
print(n-1 * m-1)

Submission status: Runtime Error

Solution code:
print(s[0] + str(len(s)-2) + s[-1])

Submission status: Runtime Error

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

s = (n - 1)*(m - 1)
print(s)

Submission status: Runtime Error

Solution code:
n, m = map(int, input())
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n, ma = map(int, input())
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
a,b=map(int,input.split())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
pritn(n+m-1)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())
print(n+m-1)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())
print(n*m - 1)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())
print((n -1 )*(m - 1))

Submission status: Runtime Error

Solution code:
n=int(input())
m=int(input())
print((m-1)*(n-1))

Submission status: Runtime Error

Solution code:
m,n=[int(input()) for i in range(2)]
print((m-1)*(n-1))

Submission status: Runtime Error

Solution code:
#def main():
    #文字列を受け取る
    s = input()

    #replaceで文字列を置き換え
    print(s.replace('2017', '2018', 1))
    #置き換え回数も指定できる。今回は必要なさそうだけど


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

Submission status: Runtime Error

Solution code:
def main():
s = input()

print(s[0] + str(len(s)-2) + s[-1])

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,m=int(input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n, m = input().split()
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
s=input()
print(s[0]+str(len(s)-2)+s[len(s-2)])

Submission status: Runtime Error

Solution code:
n,m = int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split())
print((a-1)*(B-1))

Submission status: Runtime Error

Solution code:
a, b = int(input().split())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
prnt((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inp()
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n. m = map(int, input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

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

print(int((n - 1) * (m - 1)))

Submission status: Runtime Error

Solution code:
n, m = map(int(input().split()))
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
ans = (n-1)*(m-1)
print(ans))

Submission status: Runtime Error

Solution code:
n, m = map(int, iput().split())
ans = (n-1)*(m-1)
print(ans))

Submission status: Runtime Error

Solution code:
print(int(input())*2)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split)
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
s=input()
n=s.split(" ")[0]
m=s.split(" ")[1]
 
n=n-1
m=m-1
 
r=n*m
 
print(m)

Submission status: Runtime Error

Solution code:
s=input()
n=s.split(" ")[0]
m=s.split(" ")[1]

n=n-1
m=m-1

r=n*m

print(m)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
a,b = map(int,input())

print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
s = input()
a = len(s)-2
print(s[0]+a+s[len(s)-1])

Submission status: Runtime Error

Solution code:
n=input()
m=input()
print (n*m)/2

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int,input().split()))
 
num_odd = 0
num_even = 0
num_four = 0
 
for i in l:
    if i % 4 == 0:
        num_four += 1
    elif i % 2 == 0:
        num_even += 1
    else:
        num_odd += 1
 
if num_four <= num_odd + 2:
    ans = "No"
else:
    ans = "Yes"
print(ans)

Submission status: Runtime Error

Solution code:
a=input()

b=input()

print (a-1)*(b-1)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
#069_A
n,m=map(input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n, m = map(int,input().split())
if n <= 1 or m <= 1:
    print(0)
else:
    print((n-1) * (m-1)

Submission status: Runtime Error

Solution code:
a=int(input().split())
print((a[0]-1)*(a[1]-1))

Submission status: Runtime Error

Solution code:
n,m=map(int(input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
h, w = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))

ans = []
for i in range(n):
  ans += [i+1]*l[i]

for i in range(h):
  temp = ans[i*w:(i+1)*w]
  if i%2 == 0:
    print(*temp)
  else:
    temp = reversed(temp)
    print(*temp)

Submission status: Runtime Error

Solution code:
s = input()

a = s[0]
b =len(s)-2
c = s[-1]

print(a+b+c)

Submission status: Runtime Error

Solution code:
s = input()

a = s[0]
b =len(s[1:len(s)-1])
c = s[-1]

print(a+b+c)

Submission status: Runtime Error

Solution code:
A, B =map(int, input().split())
print(max((A-1)*(B-1)))

Submission status: Runtime Error

Solution code:
n, m = int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

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

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
m=int(input())
n=int(input())
print((m-1)*(n-1))

Submission status: Runtime Error

Solution code:
m,n=int(input().split())
print((m-1)*n)

Submission status: Runtime Error

Solution code:
m,n=int(input().slide())
print((m-1)*n)

Submission status: Runtime Error

Solution code:
m,n=input().slide()
x=(m-1)n
print(x)

Submission status: Runtime Error

Solution code:
n,m=int(input()).slide()
print((m-1)n)

Submission status: Runtime Error

Solution code:
s = str(input())
print(s[0]+len(s)+s[-1])

Submission status: Runtime Error

Solution code:
s = input()
print(s[0]+len(s)+s[-1])

Submission status: Runtime Error

Solution code:
print((int(input()) - 1) * (int(input()) - 1))

Submission status: Runtime Error

Solution code:
print(int(input() - 1) * int(input() - 1))

Submission status: Runtime Error

Solution code:
a,b=str(int,input().split())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
a, b = int(input().split())
print((a-1) * (b - 1))

Submission status: Runtime Error

Solution code:
n,m = (int, input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m = (int(input()).split())
print((n-1)*(m-2))

Submission status: Runtime Error

Solution code:
m,n=(int,input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().spliy())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
print(~-a*~-b)

Submission status: Runtime Error

Solution code:
a,b= map(input().split())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
n, m = int(input())

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n, m = int(input())

a = n - 1
b = m - 1

print(a * b)

Submission status: Runtime Error

Solution code:
n,m=map(int,open(0));print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input())
print((n-a)*(m-1))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
print((n-1)*(m-1) if (n-1) > a and (m-1) > 1 else 0)

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
pirnt((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m=map(int, inaput().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n, m = map(int,inpout().split())
print((n - 1) + (m * 1))

Submission status: Runtime Error

Solution code:
s=input()
N=len(s)-2
print(s[0]+N+s[-1:])

Submission status: Runtime Error

Solution code:
print((int(input())-1)*(int(input()-1))

Submission status: Runtime Error

Solution code:
n,m = int(input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
print(int((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=a-1
d=b-1
print(c*d)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=(a-1)
d=(b-1)
print(c*d)

Submission status: Runtime Error

Solution code:
a,s=int(input().split())
print((s-1)*(a-1))

Submission status: Runtime Error

Solution code:
n, m = map(intm input().split())
print((n - 1) * (m - 1))

Submission status: Runtime Error

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

print((n-1)(m-1))

Submission status: Runtime Error

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

int(n)
int(m)


print((m-1)*(n-1))

Submission status: Runtime Error

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

int(n)
int(m)


print(m*n)

Submission status: Runtime Error

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


print(m*n)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())

print(m*n)

Submission status: Runtime Error

Solution code:
n,m=map(int, input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
a=list(map(int,input().sprit()))
print((a[0]-1)*(a[1]-1))

Submission status: Runtime Error

Solution code:
n.m=map(int,input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
r = map(lambda x:int(x)-1, input().split())
print(r[0]*r[1])

Submission status: Runtime Error

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [input() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H, W = MI()
    N = I()
    A = [(int(a),i) for i,a in enumerate(input().split(), start=1)]
    A.sort()

    stack = []
    for a,i in A:
        stack.extend([i] * a)

    ans = [[0] * W for _ in range(H)]
    for i in range(H):
        for j in range(W):
            c = stack.pop()
            if i % 2 == 0:
                ans[i][j] = c
            else:
                ans[i][W - 1 - j] = c
    for a in ans:
        print(*a)


    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:

import sys

def solve(n,m):
    return n*m//2


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    return (a, b,)

def main():
    solve(*readQuestion())

# Uncomment before submission
 main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n, m = [int(i) for i in input().split()]
if 2 <= n and m <= 100:
    print(int((n - 1)(m - 1)))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n, m = [int(i) for i in input().split()]
if 2 <= n and m <= 100:
    print((n-1)(m-1))

Submission status: Runtime Error

Solution code:
a,b = map(input().split())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split()) print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
c

Submission status: Runtime Error

Solution code:
from collections import defaultdict
N = int(input())
a = [int(i) for i in input().split()]
b = []
for x in a:
    num = 0
    if x%2 == 0:
        x = x//2
        num += 1
        if x%2 == 0:
            num += 1
    b.append(num)
if b.count(0) <= b.count(2):
    print('Yes')
else:
    if b.count(0) == b.count(2)+1 and len(b) == b.count(0)+b.count(2):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
S = input()
print(S[0] + string(len(S)-2) + S[len(S)])

Submission status: Runtime Error

Solution code:
n,m = map(int, input.split())
print((n - 1)*(m - 1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split(' '))
print(sum((n-1)*(m-1)))

Submission status: Runtime Error

Solution code:
n, m=input().split()
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {1:0, 2:0, 4:0}
for i in a:
  if i % 4 == 0:
    d[4] += 1
  elif i % 2 == 0:
    d[2] += 1
  else:
    d[1] += 1
if d.get(2, 0) >= 1:
  d[1] += 1
if d.get(1, 0) <= d.get(4, 0)+1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n,m = map(int,input().spilt())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split)
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:

n= int(input())
m= int(input())
print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n = int(input()) -1
m = int(input()) -1
print(n * m)

Submission status: Runtime Error

Solution code:
print((int(input()) -1) * (int(input()) -1))

Submission status: Runtime Error

Solution code:
n,m = int(input())
ans = (n - 1) * (m - 1)
print(ans)

Submission status: Runtime Error

Solution code:
    s=input()
    print(s[0]+str(len(s-2))+s[-1])

Submission status: Runtime Error

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math

#a = input().split()
#y = input().split()

x = int(input())
y = int(input())

x=-1
y=-1

print(x*y)

Submission status: Runtime Error

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math

#a = input().split()
#y = input().split()
a = input()

x = int(input())
y = int(input())

x=-1
y=-1

print(x*y)

Submission status: Runtime Error

Solution code:
n, m = map(int(input().split())
print((n-1)*(m-1))

Submission status: Runtime Error

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

print((n-1) * (m-1))

Submission status: Runtime Error

Solution code:
n = int(input())
#a(i)とa(i+1)について、
#(1)二つとも偶数
#一つが4の倍数
#1,4,3,4,2,2,4,5
#2の個数はなんでも良いが、4でそのまとまりを挟む必要がある
count4 = 0
count2 = 0
count_odd = 0
num_list = list(map(int, input().split()))
for i in num_list:
    if i % 4 == 0:
        count4 += 1
    elif i % 4 == 2:
        count2 = 1
    if i % 2 == 1:
        count_odd += 1
if count4 == 0:
    if count2 == 2 and count_odd == 0:
        print("Yes")
    else:
        print("No")    
if count4 >= count_odd +count2 - 1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
print(eval('('+input().replace(' ','-1)*(')+('-1)'))

Submission status: Runtime Error

Solution code:
n,m = int(input())
print((n-1) * (m-1))

Submission status: Runtime Error

Solution code:
a,b=map(int.input().split())
print(a-1*b-1)

Submission status: Runtime Error

Solution code:
n, m = map( int, input().split())
print((n-1)*(m-1))a

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
print((a-1)*(b-1) if (a-1)*(b-1) >= 4)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
print((a-1)*(b-1) if (a-1)*(b-1) >= 4 else 0)

Submission status: Runtime Error

Solution code:
n.m = map(int, input().split())
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
print((n-1)(m-1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf8 -*-
n = int(input())
m = int(input())

if n >= 2:
    if n <= 100:
        if m >= 2:
            if m <= 100:
                print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf8 -*-
n = int(input(.txt))
m = int(input(.txt))

if n > 2:
    if n < 100:
        if m > 2:
            if m < 100:
                print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf8 -*-
n = int(input())
m = int(input())

if n > 2:
    if n < 100:
        if m > 2:
            if m < 100:
                print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
# -*- coding: utf8 -*-
n = int(input())
m = int(input())

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    m = int(input())
    print( (n-1)*(m-1) )
main()

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())

a =( (n - 1) * (m - 1))

print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(input())

a = (n - 1) * (m - 1)

print(a)

Submission status: Runtime Error

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

print((n-1)*(m-1))

Submission status: Runtime Error

Solution code:
N = raw_input()
N = int(N)
s = raw_input()
s = s.split(' ')
s = [float(x) for x in s]

n_list = [0 for i in range(3)]
for i in s:
	for t in range(3):
		i = i/2
		if (i - int(i) != 0):
			n_list[t] += 1
			break
		if(t == 2):
			n_list[t] += 1

if(n_list[0] <= n_list[2]):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
N = raw_input()
N = int(N)
s = raw_input()
s = s.split(' ')
s = [float(x) for x in s]

n_list = []
for i in s:
	for t in range(3):
		i = i/2
		if (i - int(i) != 0):
			n_list.append(t)
			break
		if(t == 2):
			n_list.append(t)

if(n_list.count(0) <= n_list.count(2)):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
N = int(input())
a = list(map(int, input().split()))
 
i = 0

for x in range(H):
    c = []
    for y in range(W):
        c.append(i + 1)
        a[i] -= 1
        if a[i] == 0:
            i += 1
            
    if x % 2 == 0:
        print(*c)
    else:
        print(*c[::-1])

Submission status: Runtime Error

Solution code:
n = input()
m = input()
print((n - 1) * (m - 1))

Submission status: Runtime Error

Solution code:
n, m = input().split(' ')
print((n - 1) * (m  - 1))

Submission status: Runtime Error

Solution code:
def solve(): # 069A - K-City
    n, m = int(input())
    print((m-1) * (n-1))


solve()

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
if a<=b:
    z=a
    c=b
    d=c-z
else:
    z=b
    c=a
    d=c-z
z=z-1
x=z*z
for count in range(d):
    x=x+z
print (x)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
if a<=b:
    z=a
    c=b
    d=c-z
else:
    z=b
    c=a
    d=c-z
z=z-1
x=z*z
for count in range(d):
    x=x+z
    
print (x)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
if a<=b:
    z=a
    c=b
    d=c-z
else:
    z=b
    c=a
    d=c-z
z=z-1
x=z*z
for count in range(d):
    x=x+z
    
print (x)

Submission status: Runtime Error

Solution code:
from sys import stdin
input = stdin.readline
def BFS(K,path,N):
  """リストのリスト道順path,頂点の個数Nが与えられたとき, 頂点Kから各頂点までの距離をlistで返す"""
  import queue
  dist=[-1]*N
  dist[K]=0
  que=queue.Queue()
  que.put(K)
  while que.qsize():
    label=que.get()
    for i,c in path[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        que.put(i)
  return dist
 
N=int(input())
path=[ [] for i in range(N)]
for i in range(N-1):
  a,b,c=map(int,input().split())
  path[a-1]+=[(b-1,c)]
  path[b-1]+=[(a-1,c)]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,path,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])

Submission status: Runtime Error

Solution code:
print( ( int(input()) - 1 ) * ( int(input()) - 1) )

Submission status: Runtime Error

Solution code:
n=input("east_west road:")
print(n)
m=input("north_south road:")
print(m)
block =(int(n)-1) * (int(m)-1)
print(block)

Submission status: Runtime Error

Solution code:
n=input("east_west road:")
m=input("north_south road:")
block =(int(n)-1) * (int(m)-1)
print(block)

Submission status: Runtime Error

Solution code:
n = input("east_west road:")
m =input("north_south road:")
block =(int(n)-1) * (int(m)-1)
print(block)

Submission status: Runtime Error

Solution code:
N = int(input())
al = [int(a) for a in input().split()]
a = [ "4" if al[i]%4==0 else "k" if al[i]%2!=0 else "g" for i in range(N)]
if a.count("k") == a.count("4"):
	print("Yes")
elif (a.count("k") - 1) == a.count("4")  and a.count("g")==0:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    h, w = map(int, input().split())
    n = int(input())
    a = list(map(int, input().split()))

    c = [0] * (h*w)
    
    focus = 0
    for i in range(n):
        for j in range(a[i]):
            c[focus] = i+1
            focus += 1

    for i in range(h):
        for j in range(w):
            if(i%2 == 0):
                if(j + 1 != w):
                    print(c[i*w+j],end=" ")
                else:
                    print(c[i*w+j])
            else:
                if(j + 1 != w):
                    print(c[(i+1)*w-1-j],end=" ")
                else:
                    print(c[(i+1)*w-1-j])

Submission status: Runtime Error

Solution code:
H,W = map(int, input().split())
N = int(input())
a = list(map(int, input().split()))
i = 0
s = ["" for j in range(H)]
for y in range(H):
    for x in range(W):
        if x != 0: s[y] = s[y] + " "
        s[y] = s[y] + str(i+1)
        a[i] = a[i] - 1
        if a[i] == 0:
            i = i+1
    if y%2 == 0 : print(s[y])
    else:
        print(" ".join(s[y].split()[::-1]))

Submission status: Runtime Error

Solution code:
m,n = int(input().split())
print((m-1)*(n-1))

Submission status: Runtime Error

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

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count == N:
    result = 'Yes'
elif two_count * 2 + 1 >= N:
    if (N - two_count) == 1:
        if four_count >= 1:
            result = 'Yes'
    else:
        if (N - two_count) - 1<= four_count:
            result = 'Yes'


print(result)

Submission status: Runtime Error

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

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count * 2 + 1 >= N:
    if (N - two_count) == 1:
        if four_count == 1:
            result = 'Yes'
    else:
        if (N - two_count) - 1<= four_count:
            result = 'Yes'

print(result)

Submission status: Runtime Error

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

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count * 2 + 1 >= N:
    if (N - two_count) - 1<= four_count:
        result = 'Yes'

print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
S = []
for i in range(n):
    S.append(input())


ans = set(S[0])

for j in range(1,N):
    ans = ans & set(S[j])

print(str(ans))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Here your code !
import math
N = input()
A = list(map(int, input().split()))

f,e,d = 0,0,0

for a in A:
    x = a % 4
    if(x==0):
        f = f+1
    elif(x==2):
        e = e+1
    else:
        d = d+1
if(e>0): d = d+1
if(d <= math.ceil(len(A)/2)):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
printf((n-1)*(m-1))