Problem:


Score : 100 points

Problem Statement

There are H rows and W columns of white square cells.

You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.

How many white cells will remain?

It can be proved that this count does not depend on what rows and columns are chosen.

Constraints

All values in input are integers.

1 \leq H, W \leq 20

1 \leq h \leq H

1 \leq w \leq W

Input

Input is given from Standard Input in the following format:

H W
h w

Output

Print the number of white cells that will remain.

Sample Input 1

3 2
2 1

Sample Output 1

1

There are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.

Sample Input 2

5 5
2 3

Sample Output 2

6

Sample Input 3

2 4
2 4

Sample Output 3

0



Sample input:
3 2
2 1


Sample output:
1

Submission status: Wrong Answer

Solution code:
import io, sys, atexit, os

import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


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


def num ():
	return map (int, input ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


mm = 1000000007



def solve ():
	t = 1
	for it in range (t):
		a,b=num()
		c,d=num()
		print(a*b-c*d)





if __name__ == "__main__":
	solve ()

Submission status: Wrong Answer

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

from pprint import pprint
from random import shuffle, sample

import numpy as np
import random

H, W = 2, 4
h, w = 2, 4

# True  := Black
# False := White

array = np.zeros((H, W), dtype=np.bool)

for r in sample(list(range(H)), h):
    array[r, :] = True

for c in sample(list(range(W)), w):
    array[:, c] = True

print(len(array[array == False]))

Submission status: Wrong Answer

Solution code:
matrix = list(map(int,input().split()))
shitei = list(map(int,input().split()))

masume = matrix[0]*matrix[1]
black = shitei[0]*matrix[1]+shitei[0]*(matrix[0]-shitei[0])
white = masume-black

print(white)

Submission status: Wrong Answer

Solution code:
H,W=input().split()
h,w=input().split()

x=int(H)-int(W)
y=int(h)-int(w)
print(x*y)

Submission status: Wrong Answer

Solution code:
def white_marker():
  line, row = map(int,input().split())
  line_marker, row_marker = map(int, input().split())
  line -= line_marker
  row -= row_marker
  
  return line * row

Submission status: Wrong Answer

Solution code:
def F(n):
    res = 0
    if n % 4 == 0:
        res = n
    elif n % 4 == 1:
        res = 1
    elif n % 4 == 2:
        res = n + 1
    else:
        res = 0
        
    return res

def main():
    A, B = map(int, input().split())
    ans = F(B) ^ F(A-1)

    #print(A, B, F(A-1), F(B))

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
K,W = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]
print (K*W -(K-h)*(W-w))

Submission status: Wrong Answer

Solution code:
K,W = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]
print (K*W -(K-w)*(W-h))

Submission status: Wrong Answer

Solution code:
import numpy as np

print(3)

Submission status: Wrong Answer

Solution code:
def main():
  print("debug")
  
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
def calc(A):
    if A%4==0:
        return A
    elif A%4==1:
        return 1
    elif A%4==2:
        return A+1
    else:
        return 0
print(calc(A-1)^calc(B))

Submission status: Wrong Answer

Solution code:
"""White Cells"""
H,W=(int(i) for i in input().split())
h,w=(int(i) for i in input().split())
H*W-H*w-W*h+h*w

Submission status: Wrong Answer

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

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

print(a*b-h*w)

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))

white = H*W
black = h*W + (w-h)*H

print(white-black)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 17:00:19 2019

@author: Koki Yagihara
"""

H, W = map(int, input().split())
h, w = map(int, input().split())
s = 1
white = H*W
black = h + w - s
R = white - black
print("{}".format(R))

Submission status: Wrong Answer

Solution code:
from math import log2
num_digit = lambda n: int(log2(n)+1)    

def to_digits(num, nd):
    rest = num
    ret = []
    for i in list(range(nd))[::-1]:
        d = pow(2, i)
        n = int(rest/d)
        rest = rest - d*n
        ret.append(n)
    return ret

def to_num(digits):
    nd = len(digits)
    ret = 0
    for dig, i in zip(digits, list(range(nd))[::-1]):
        d = int(pow(2, i))
        ret += dig*d
    return ret

def solve(A, B):
    nd = num_digit(B)
    digitss = [to_digits(n, nd) for n in range(A, B+1)]
    return to_num([digits.count(1) %2 for digits in zip(*digitss)])
  
A, B = [int(s) for s in input().split()]
print(solve(A, B))

Submission status: Wrong Answer

Solution code:
from math import *
num_digit = lambda n: int(log2(n)+1)    
A, B = [int(s) for s in input().split()]

ret = 0
N = (B-A)+1
nd = num_digit(B)
for i in range(nd):
    nb = int(pow(2, i+1) if i>0 else pow(2, i+2))
    nr = N%nb
    s = sum([(A+j) >> i for j in range(nr)])
    ret += ((s%2) << i)
    
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = input().split(' ')
h, w = input().split(' ')
H = int(H)
W = int(W)
h = int(w)
w = int(w)

print(h*W+H*w-h*w)

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

ans = 0
ans = H*W-(h*W+w*H-h*w)
ans

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

ans = H*W-(h*W+w*H-h*w)
ans

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

H*W-(h*W+w*H-h*w)

Submission status: Wrong Answer

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

# Insert all the data into dictionary
stores = []
while 1:
	try:
		a, b = list(map(int, input().split()))
		stores.append([a,b])
	except:
		break

stores = sorted(stores, key=lambda x:x[0])

m = 0
money = 0

for store in stores:
	money += min(store[1], M - m) * store[0]
	if m == M:
		break
print(money)
        
print(stores)

Submission status: Wrong Answer

Solution code:
from itertools import combinations, product


def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a

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


def get(fmt):
    ps = input().split()
    r = []
    for p, t in zip(ps, fmt):
        if t == "i":
            r.append(int(p))
        if t == "f":
            r.append(float(p))
        if t == "s":
            r.append(p)
    if len(r) == 1:
        r = r[0]
    return r

def put(*args, **kwargs):
    print(*args, **kwargs)


def rep(n, f, *args, **kwargs):
    return [f(*args, **kwargs) for _ in range(n)]
    
def rep_im(n, v):
    return rep(n, lambda: v)
    
YES_NO = ["NO", "YES"]

H, W = get("ii")
h, w = get("ii")

put(H * W - h * H - w * W + h * w)

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

print(H*W-H*w-h*W-h*w)

Submission status: Wrong Answer

Solution code:
h1, w1 = list(map(int, input().split()))
h2, w2 = list(map(int, input().split()))
print((h1 - h2) * (w2 - w1))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H*W-H*h-W*w+h*w)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
hi,wi=map(int,input().split())

print(W*hi+H*wi-hi*wi)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H*W - (H - h)*(W - w))

Submission status: Wrong Answer

Solution code:
import scipy as sp

answer = 0
A, B = map(int, input().split()) 
for i in sp.arange(A, B+1):
    answer = answer ^ i
print(answer)

Submission status: Wrong Answer

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

import numpy as np

INPUT=input().split( )
Input=input().split( )
H=int(INPUT[0])
W=int(INPUT[1])
h=int(Input[0])
w=int(Input[1])

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(mat.sum())

Submission status: Wrong Answer

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

import numpy as np

INPUT=input().split()
Input=input().split()
H=int(INPUT[0])
W=int(INPUT[1])
h=int(Input[0])
w=int(Input[1])

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(np.sum(mat))

Submission status: Wrong Answer

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

import numpy as np

INPUT=input().split()
Input=input().split()
H,W=int(INPUT[0]),int(INPUT[1])
h,w=int(Input[0]),int(Input[1])

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(np.sum(mat))

Submission status: Wrong Answer

Solution code:
H, W = input().split()
h, w = input().split()
print(H, W, h, w)
ans = (int(H) - int(h)) * (int(W) - int(w))
print(ans)

Submission status: Wrong Answer

Solution code:
s = map(int, raw_input().rstrip().split(' '))
z = map(int, raw_input().rstrip().split(' '))
print (s[0]-z[0]) * (s[0]-z[1])

Submission status: Wrong Answer

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

def xor(n):
  if n % 2 == 0:
    if int(n / 2) % 2 == 0:
      return n
    else:
      return n ^ 1
  else:
    if int((n - 1) / 2) & 2 == 0:
      return 0
    else:
      return 1

print(xor(A - 1) ^ xor(B))

Submission status: Wrong Answer

Solution code:
tmp = input()
H = int(tmp.split()[0])
W = int(tmp.split()[1])

tmp = input()
h = int(tmp.split()[0])
w = int(tmp.split()[1])

ans = W*h+H*w - h*w
print(ans)

Submission status: Wrong Answer

Solution code:
H, W = (int(num) for num in input().split())
h, w = (int(num) for num in input().split())
print(H*W-h*w)

Submission status: Wrong Answer

Solution code:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
 
H = HW[0]
W = HW[1]
 
h = hw[0]
w = hw[1]
 
if H >= W:
  print(H * W - (H * h + (W - h) * w))
else:
  print(H * W - (W * h + (H - h) * w))

Submission status: Wrong Answer

Solution code:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
 
H = HW[0]
W = HW[1]
 
h = hw[0]
w = hw[1]
 
if H <= W:
  print(H * W - (H * h + (W - h) * w))
else:
  print(H * W - (W * h + (H - h) * w))

Submission status: Wrong Answer

Solution code:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
 
H = HW[0]
W = HW[1]
 
h = hw[0]
w = hw[1]

if H <= W:
  print(H * W - (H * h + (W - h) * w))
else:
  print(H * W - (W * w + (H - w) * h))

Submission status: Wrong Answer

Solution code:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
 
H = HW[0]
W = HW[1]
 
h = hw[0]
w = hw[1]
 
print(H * W - (H * h + (W - h) * w))

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

H, W = input().split()
h, w = input().split()

H = int(H)
W = int(W)
h = int(h)
w = int(w)

print(H, W, h, w)

remain = H * W  #  最初の白いマス
remain -= h * W
remain -= w * (H - h)

print(remain)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c, d = map(int, input().split())
[print("0") if (a*b)==(c*d) else print(c*d)]

Submission status: Wrong Answer

Solution code:
H, W = map(int,input().split())
h, w = map(int, input().split())

print(H*W-H*h-W*w+h*w)

Submission status: Wrong Answer

Solution code:
a,b=[int(x) for x in input().split()]
if a>b:
  a,b=b,a
tmp=0
for p in range(a,b+1):
  tmp^=p
print(tmp)

Submission status: Wrong Answer

Solution code:
val1 = input().split(" ")
H = int(val1[0])
W = int(val1[1])

val2 = input().split(" ")
h = int(val2[0])
w = int(val2[1])

if w == W or h == H:
	print(0)
elif W == 1 or H == 1:
	print(0)
elif W == 20 or H == 20:
	print(0)
else:

	arr = [["○" for i in range(W)] for j in range(H)]

	for k in range(h):
		del arr[0]


	result = 0
	for a in arr:
		for l in range(w):
			del a[0]
		result += len(a)

	print(result)

Submission status: Wrong Answer

Solution code:
h, w = map(int,input().split())
x, y = map(int, input().split())
print(h*w - h*x - w*y + x*y)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
num = B - A
result = (num // 2) % 2
if num % 2 == 1:
  result ^= (B-1) ^ B
else:
  result ^= B
print(result)

Submission status: Wrong Answer

Solution code:
val1 = input().split(" ")
H = int(val1[0])
W = int(val1[1])

val2 = input().split(" ")
h = int(val2[0])
w = int(val2[1])

if w == W or h == H:
	print(0)
elif W == 1 or H == 1:
	print(0)
elif W == 20 or H == 20:
	print(0)
else:

	arr = [["○" for i in range(W)] for j in range(H)]

	for k in range(h):
		arr.pop(0)


	result = 0
	for a in arr:
		for l in range(w):
			a.pop(0)
		result += len(a)

	print(result)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())  # 複数数値入力

A = list()
B = list()

if b == 0:
    B = [0]
elif b == 1:
    B = [1]
else:
    for i in range(1, int(math.log2(b))+2):
        tmp = b // (2 ** i) * 2 ** (i - 1)

        if b % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = b % (2 ** i) - 2 ** (i-1) + 1

        B.append(tmp + plus)

if a == 0:
    A = [0]
elif a == 1:
    A = [0]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

ans = 0
for i in range(0, int(math.log2(b)) + 1):
    print(i)
    if i >= len(A):
        ans += (B[i]) % 2 * 10 ** i
    else:
        ans += (B[i] - A[i]) % 2 * 10 ** i

print(int(str(ans), 2))

Submission status: Wrong Answer

Solution code:
A,B  = map(int,input().split())
 
xor = A
for i in range(B-A):
    xor = xor ^ (A + i+1)
 
print(xor)

Submission status: Wrong Answer

Solution code:
A, B = map(long, raw_input().split())
ans = A
for i in range(A + 1, B + 1):
    ans = ans ^ i

print(ans)

Submission status: Wrong Answer

Solution code:
H, W = (int(i) for i in input().split())
h, w = (int(i) for i in input().split())
print(H*W-h*w)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * w - (h * W + w * H - h * w))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + w * H - h * w)

Submission status: Wrong Answer

Solution code:
s = [input().split() for i in range(2)]
print(s)

a, b, c, d = int(s[0][0]), int(s[0][1]), int(s[1][0]), int(s[1][1])

sum_cells_count = a * b
row_cells_count = b * c
col_cells_count = (a - c) * d

filled_cells_count = row_cells_count + col_cells_count

blank_cells_count = sum_cells_count - filled_cells_count
blank_cells_count

Submission status: Wrong Answer

Solution code:
s = [input().split() for i in range(2)]
print(s)

a, b, c, d = int(s[0][0]), int(s[0][1]), int(s[1][0]), int(s[1][1])

sum_cells_count = a * b
row_cells_count = b * c
col_cells_count = (a - c) * d

filled_cells_count = row_cells_count + col_cells_count

blank_cells_count = sum_cells_count - filled_cells_count
print(blank_cells_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

pre = A
for i in range(A+1,B+1):
    pre  = pre ^ i
print(pre)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

a=H*W
b=h*w

print((a+h*W+H*w)-b)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

a=H*W
b=h*w

print(a+h*W+H*W-b)

Submission status: Wrong Answer

Solution code:
import numpy as np
H,W = map(int,input().split())
h,w = map(int,input().split())
matrix = np.ones((H,W))
h_num = np.random.choice(H,h,replace=False)
w_num = np.random.choice(W,w,replace=False)

for _ in h_num:
  matrix[_,:] = 0
for _ in w_num:
  matrix[:,_] = 0

print(np.sum(matrix))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

a=H*W
b=h*w

print(a-b)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H*W-H*h-W*w+h*w)

Submission status: Wrong Answer

Solution code:
H, W = [int(_) for _ in input().split()]
h, w = [int(_) for _ in input().split()]
print(H*W-h*w)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    list = [[i for i in map(int, line.rstrip().split())] for line in sys.stdin.readlines()]
    a = (list[0][0] - list[0][1]) *  (list[1][0] - list[1][1])
    print(a)

if __name__ == '__main__':
    sys.exit(main())

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())
h,w = map(int, input().split())

total = H* W
ans = total - (H*h + W*w - h*w) 
print (ans)

Submission status: Wrong Answer

Solution code:
H,W = list(map(int, input().split()))
h,w = list(map(int, input().split()))
print(W*H-(W-w)*(H-h))

Submission status: Wrong Answer

Solution code:
import numpy as np

H, W = map(int, input().split())
h, w = map(int, input().split())

table = np.array(np.ones((H, W)))
table[:h] = 0
table[:,:w] = 0
print(np.sum(table))

Submission status: Wrong Answer

Solution code:
H,W = list(map(int, input().split()))
h,w = list(map(int, input().split()))
print(h*w+H+W-h-w)

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())
h,w = map(int, input().split())
ans = H * W - (h+w-1)
print (ans)

Submission status: Wrong Answer

Solution code:
#121-A
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
H,W=IL()
h,w=IL()
print(H*W-h*w)

Submission status: Wrong Answer

Solution code:
a,b=[int(x)for x in input().split()]
c,d=[int(x)for x in input().split()]
print(a*b-c*d)

Submission status: Wrong Answer

Solution code:
H, W= map(int, input().split())
h, w= map(int, input().split())

A = h * W
B = H * w
print(A + B - h*w)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H*W- (W*h + H*w - (h+w-1)))

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
a=H*W
print(a-H*h-(H-h)*w)

Submission status: Wrong Answer

Solution code:
H,W = list(map(int,input().split()))
h,w = list(map(int,input().split()))
print(H,W,h,w)
ans = h*W + w*H - h*w
print(H*W-ans)

Submission status: Wrong Answer

Solution code:
W, H =  map(int, input().split())
w, h =  map(int, input().split())

print(W*H - w*h)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(h * W + H * w - h * w)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
y, x = map(int, input().split())

print(h * w - h * y - w * x + x * y)

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

ans = H*W - (H+W)
print(ans)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())

print(h*W+w*H-h*w)

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split(" "))
h,w = map(int, input().split(" "))

print(H*W-H*w-w*H+w*h)

Submission status: Wrong Answer

Solution code:
h,w = map(int, input().split())
a,b = map(int, input().split())

print(h*w-h-w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

print(h+w-1)

Submission status: Wrong Answer

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

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
x,y = map(int,input().split())

print((h-x)*(w-y))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H * W - (h*W + w*H - h*w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

ans = H*W - h*W - w*(H-h)
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
h,w = map(int,input().split())

print((a - h) * (b - w))

Submission status: Accepted

Solution code:
H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())

H=H1-H2
W=W1-W2

print(H*W)

Submission status: Accepted

Solution code:
H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())
print((H1-H2)*(W1-W2))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H, W = map(int,input().split())
h, w = map(int,input().split())
print(H*W - (h*W+w*H - h*w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h) * (W-w))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
i,j = map(int,input().split())
print((h-i)*(w-j))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H*W - (h*W + w*H - h*w))

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-H*w-W*h+w*h)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
a = H - h
b = W - w
print(a * b)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h) * (W - w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
t = H * W
o = h*W + w*H
c = h*w
diff = o - c
print(t - diff)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
ans = (H-h) * (W-w)
print(ans)

Submission status: Accepted

Solution code:
H,M=map(int,input().split())
h,m=map(int,input().split())
print((H-h)*(M-m))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W=map(int, input().split())
h,w=map(int, input().split())

print((H-h)*(W-w))

Submission status: Accepted

Solution code:
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

H,W=input2()
h,w=input2()

ans= (H-h)*(W-w)
print(ans)

Submission status: Accepted

Solution code:
rows, columns = map(int, input().split())
black_rows, black_columns = map(int, input().split())

area = rows * columns
black_space = black_columns * rows + black_rows * columns - black_rows * black_columns

print(area - black_space)

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    H, W = Input()
    h, w = Input()
    print(H * W - ((H * w + W * h) - (h * w)))

main()

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
ans = H * W - H * w - h * W + h * w
print(ans)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H*W - (h*W + w*H - h*w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
white = H*W
black = (W*h) + ((H-h)*w) 
print(white - black)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-H*w-W*h+h*w)

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

print(H*W-W*h-H*w+w*h)

Submission status: Accepted

Solution code:
H,W=list(map(int, input().split()))
h,w=list(map(int, input().split()))
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H,W=list(map(int,input().split()))
h,w=list(map(int,input().split()))
print(H*W-h*W-w*H+h*w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H - h) * (W - w))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H * W - h * W - w * H + h * w)

Submission status: Accepted

Solution code:

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-h*W-H*w+h*w)

Submission status: Accepted

Solution code:
h1, w1 = map(int, input().split())
h2, w2 = map(int, input().split())
print((h1 - h2) * (w1 - w2))

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*W-H*w+h*w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h1, w1 = map(int, input().split())
h2, w2 = map(int, input().split())

print((h1 - h2) * (w1 - w2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

print((H - h) * (W - w))

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())

print(H*W-h*W-H*w+h*w)

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-(H*w+W*h-h*w))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = [int(i) for i in input().split()]
n = (H-h) * (W-w)
print(n)

Submission status: Accepted

Solution code:
def main():
    H, W = map(int, input().split())
    h, w = map(int, input().split())

    print((H - h) * (W - w))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H*W - h*W - H*w + h*w)

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-W*h-H*w+h*w)

Submission status: Accepted

Solution code:
H, W = map(int,input().split())
h, w = map(int,input().split())
print(H*W + h*w - H*w - W*h)

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
x,y = map(int,input().split())
print(h*w-w*x-h*y+x*y)

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
s,t = map(int,input().split())
print(h*w-s*w-t*h+s*t)

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())

HW=[]

for i in range(H):
  sublist=[]
  for j in range(W):
    sublist.append(0)
  HW.append(sublist)


# 行
for i in range(h):
  for j in range(W):
    HW[i][j]=1


# 列
for i in range(w):
  for j in range(H):
    if HW[j][i]==1: continue
    HW[j][i]=1

cnt=0

for i in range(H):
  for j in range(W):
    if HW[i][j]==0:
      cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int, input().split())
print((H*W)-(h*W)-(w*H)+(h*w))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    H, W, h, w = map(int, read().split())

    print((H - h) * (W - w))

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
a, b, c, d = map(int, sys.stdin.read().split())
print((a-c)*(b-d))

Submission status: Accepted

Solution code:
H,W = map(int, input().split())
h,w = map(int, input().split())
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
H,W = map (int, input ().split ())
h,w = map (int, input ().split ())
x = H-h
y = W-w
print (x*y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H*W-h*W-w*H+h*w)

Submission status: Accepted

Solution code:
H, W = (int(x) for x in input().split())
h, w = (int(x) for x in input().split())


ans=H*W-(h*W+(H-h)*w)
print(ans)

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))

print(H * W - h * W - H * w + h * w)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

H,W=map(int, input().split())
h,w=map(int, input().split())

print(H*W-h*W-w*H+h*w)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

white_start = H * W
black = w * H + (W - w) * h
white_end = white_start - black
print(white_end)

Submission status: Accepted

Solution code:
H, W = map(int, input().strip().split())
h, w = map(int, input().strip().split())

res = (H - h) * (W - w)
print(res)

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
h,w = map(int,input().split())

print(H*W - h*W - H*w + h*w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

H,W = MI()
h,w = MI()
print((H-h)*(W-w))