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: Accepted

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

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

Submission status: Accepted

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

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

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:
H,W=map(int,input().split())
h,omega=map(int,input().split())

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

Submission status: Accepted

Solution code:
def readln():
    return list(map(int, input().split()))


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

Submission status: Accepted

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

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

Submission status: Accepted

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

num = int(H) * int(W)
num -= int(W) * int(h)
num -= int(w) * (int(H) - int(h))

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((h-h1)*(w-w1))

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:
A,B = input().split()
a,b = input().split()
A = int(A)
B = int(B)
a = int(a)
b = int(b)
print(A*B-a*B-b*A+a*b)

Submission status: Accepted

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

print((h-h_black)*(w-w_black))

Submission status: Accepted

Solution code:
a = list(int(_) for _ in input().split())
b = list(int(_) for _ in input().split())

print(a[0]*a[1]-(a[0]*b[1]+a[1]*b[0]-b[0]*b[1]))

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:
x,y = map(int, input().split())
a,b = map(int, input().split())

print((x-a)*(y-b))

Submission status: Accepted

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

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:
#coding: utf-8
import numpy as np
H, W = map(int, input().split())
h, w = map(int, input().split())
goban = np.array([[1 for i in range(W)] for j in range(H)])
goban[:h :] = 0
goban[:, :w] = 0
print(np.sum(goban))

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) + (W * h) - (w * h)))

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:
def solver(hh, ww, h, w):
    return hh * ww - h * ww - w * hh + h * w

if __name__ == '__main__':

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

    ans = solver(hh, ww, h, w)
    print(ans)

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*W - ((h*W) + (w*(H-h))))

Submission status: Accepted

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

k,l = map(int,input().split())

print(a*b - (l*a+k*b-l*k))

Submission status: Accepted

Solution code:
n=list(map(int,input().split()))
m=list(map(int,input().split()))
kuro=m[0]*n[1] + m[1]*n[0] -m[0]*m[1]
siro=n[0]*n[1]-kuro
print(siro)

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:
A,B=map(int,input().split())
C,D=map(int,input().split())
print(A*B-D*A-B*C+D*C)

Submission status: Accepted

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

Submission status: Accepted

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

W -= w
H -= h

print(H*W)

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  3 20:59:27 2019

@author: doppe
"""
H, W = map(int, input().split())
h, w = map(int, input().split())

num = H * W
num = num - H * w
num = num - (W - w) * h

print(num)

Submission status: Accepted

Solution code:
import numpy as np

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

mat = np.ones((H, W), dtype=np.int)

for i in range(h):
    mat[i, :] = 0
for j in range(w):
    mat[:, j] = 0

print(np.sum(mat))

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))

print((HW[0]-hw[0]) * (HW[1]-hw[1]))

Submission status: Accepted

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

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, W = map(int, input().split())
h, w = map(int, input().split())
H * W
ans = H * W - (H * w + W * h - h * w)
print(ans)

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

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

Submission status: Accepted

Solution code:
import sys

l = raw_input().split()
H = int(l[0])
W = int(l[1])
l = raw_input().split()
h = int(l[0])
w = int(l[1])

ret = (H - h)*(W - w)

print(ret)

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())
sum = H * W
diff = h*W + w * H -h*w
print(sum-diff)

Submission status: Accepted

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

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=input().split()
a=int(a)
b=int(b)
c,d=input().split()
c=int(c)
d=int(d)
print(a*b-c*b-a*d+c*d)

Submission status: Accepted

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+w*H-h*w))

Submission status: Accepted

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

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

Submission status: Accepted

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

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()]
print(((H-h)*W)-(H-h)*w)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input1 = input()
input2 = input()

W,H = list(map(int, input1.split()))
w,h = list(map(int, input2.split()))

print((W-w)*(H-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())
ans = (H - h) * (W - w)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar  1 19:29:34 2019

@author: nakamuratakayuki
"""

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

Submission status: Accepted

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 + W*h - h*w))

Submission status: Accepted

Solution code:
import sys

def main():
    l1 = sys.stdin.readline()
    lst = l1.split()
    height = int(lst[0])
    width = int(lst[1])

    l2 = sys.stdin.readline()
    lst = l2.split()
    h = int(lst[0])
    w = int(lst[1])

    ans = height * width - h * width - w * height + h * w
    print(ans)

    return 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

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)+(h*w))

Submission status: Accepted

Solution code:
H,W=map(int, raw_input().split())
h,w=map(int, raw_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 + H * w - h * w))

Submission status: Accepted

Solution code:
h, w = (int(i) for i in input().split())
h_p, w_p = (int(i) for i in input().split())

print(h*w-(h*w_p+w*h_p-h_p*w_p))

Submission status: Accepted

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

ans = H*W

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(H*M - h*M - H*m + h*m)

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:
l1 = input().split(" ")
l2 = input().split(" ")
print((int(l1[0])-int(l2[0]))*(int(l1[1])-int(l2[1])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
 
H,W = sys.stdin.readline().strip().split()
H = int(H)
W = int(W)
 
h,w = sys.stdin.readline().strip().split()
h = int(h)
w = int(w)

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

Submission status: Accepted

Solution code:
import sys
# import bisect
# import math
# import itertools
# import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    H, W = ip.IL()
    h, w = ip.IL()
    print(H*W-(W*h+H*w-(h*w)))




main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

#print H,W,h,w

print (H-h) * (W-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:
def main():
	H, W = map(int, input().split())
	h, w = map(int, input().split())
	m = []
	for i in range(H):
		t = []
		for j in range(W):
			t.append(1)
		m.append(t)
	for i in range(h):
		for j in range(W):
			m[i][j] = 0
	for i in range(w):
		for j in range(H):
			m[j][i] = 0
	s = 0
	for i in range(H):
		s += sum(m[i])
	print(s)
	return

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

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:
inp =input().split()
inp2=input().split()

s = int(inp[0]) - int(inp2[0])
d = int(inp[1]) - int(inp2[1])

k = s * d
print(k)

Submission status: Accepted

Solution code:


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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((h-sh)*(w-sw))

Submission status: Accepted

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

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

Submission status: Accepted

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


'''考え方
(H-h)行*(W-w)列
'''
output = (H-h) * (W-w)

print(output)

Submission status: Accepted

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

print(H*W-H*w-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:
h1,w1=map(int,input().split())
h2,w2=map(int,input().split())
val1=h1*w1
val2=h2*w1+(h1*w2)
val2-=(h2*w2)
print(val1-val2)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
""" AtCoder """

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

h2 = H - h
w2 = W - w

print(h2*w2)

Submission status: Accepted

Solution code:
HW = list(map(int, input().split()))
H = HW[0]
W = HW[1]
hw = list(map(int, input().split()))
h =hw[0]
w = hw[1]
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-h)*(W-w))

Submission status: Accepted

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

x = H * W
x -= h * W
x -= w * (H - h)

print(x)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


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

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

Submission status: Accepted

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

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

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

a = h*w
ans1 = H*W 
ans2 = h*W
ans3 = w*H

print(ans1 - ans2 - ans3 + a)

Submission status: Accepted

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

Submission status: Accepted

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

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

tot = H * W

rows = h * W
cols = H * w
common = h * w

print(tot - rows - cols + common)

Submission status: Accepted

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

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

print(total-black)

Submission status: Accepted

Solution code:
from sys import stdin
H,W=[int(x) for x in stdin.readline().rstrip().split()]
h,w=[int(x) for x in stdin.readline().rstrip().split()]
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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())
x,y= map(int, input().split())

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

Submission status: Accepted

Solution code:
H, W = [int(i) for i in input().split()]
h, w = [int(i) for i in 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())

n = H*W

n -= h*W
n -= (H-h)*w

print(n)

Submission status: Accepted

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

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

H -= h
W -= w

print(H*W)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2019/3/9
Solved on 2019/3/9
@author: shinjisu
"""


# ABC 121
# import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


ALPHABET = [chr(i+ord('a')) for i in range(26)]
DIGIT = [chr(i+ord('0')) for i in range(10)]
N1097 = 10**9 + 7
INF = 10**12


def dmp(x, cmt=''):
    global debug
    if debug:
        if cmt != '':
            print(cmt, ':  ', end='')
        print(x)
    return x


def prob_A():
    H, W = getIntList()
    h, w = getIntList()
    dmp((H, W))
    dmp((h, w))
    ans = (H-h)*(W-w)
    return ans


debug = False  # True False
ans = prob_A()
print(ans)
#for row in ans:
#    print(row)


def prob_B():
    A, B, K = getIntList()
    dmp((A, B, K))
    count = 0
    i = 100
    while count < K:
        if A % i == 0 and B % i == 0:
            count += 1
            if count == K:
                break
        i -= 1
    return i


def prob_C():
    S = input()
    red = 0
    blue = 0
    for cube in S:
        if cube == '0':
            red += 1
        else:
            blue += 1
    dmp((red, blue))
    return min(red, blue)*2


def prob_D():
    global N, M, A, B
    N, M = getIntList()
    dmp((N, M))
    A = zeros(M)
    B = zeros(M)
    for i in range(M):
        A[i], B[i] = getIntList()
    dmp(A, 'A')
    dmp(B, 'B')
    count = dmp(countInconv(), 'orginal')
    for i in range(M):
        A[i] = -1
        B[i] = -1
        dmp(A, 'A')
        dmp(B, 'B')
        print(countInconv())
    return count

Submission status: Accepted

Solution code:
x = input()
y = x.split(" ")
map = [int(i) for i in y]
x = input()
y = x.split(" ")
cell = [int(i) for i in y]
map[0] = map[0] - cell[0]
map[1] = map[1] - cell[1]
print(map[0]*map[1])

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 - White Cells
"""


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

b = h * W + w * H - h * w
w = H * W - b

print w

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
H, W = [int(x) for x in input().split()]
h, w = [int(x) for x in input().split()]
ret = (H - h) * (W - w)
print(ret)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(H * W  - W * h - (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-h)))

Submission status: Accepted

Solution code:
import collections
import itertools
import numpy as np
import sys
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

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

sum1 = H * w
sum2 = W * h
sum3 = h * w
sum4 = H * W

print(sum4 - (sum1 + sum2 - sum3))

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:
import numpy as np


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()]
print(H*W - h*W - w*H + h*w)

Submission status: Accepted

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

Submission status: Accepted

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

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 = map(int, input().split())
h, w = map(int, input().split())

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

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(int(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)+h*W))

Submission status: Accepted

Solution code:
s = [input().split() for i in range(2)]
H = int(s[0][0])
W = int(s[0][1])
h = int(s[1][0])
w = int(s[1][1])

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:
#coding:utf-8

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

all_cell = H * W

all_cell -= W*h
all_cell -=  (H-h) * w

print(all_cell)

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:
def main():
    H,W = map(int, input().split())
    h,w = map(int, input().split())
    print((H-h)*(W-w))
    
main()

Submission status: Accepted

Solution code:
import itertools


def main():
    h, w = (int(z) for z in input().split())
    n, m = (int(z) for z in input().split())
    res = 0
    for r, c in itertools.product(range(h), range(w)):
        if 0 <= r < n or 0 <= c < m:
            pass
        else:
            res += 1
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
h,w = map(int, raw_input().split())
mat = [[0 for i in xrange(w)] for j in xrange(h)]
a,b = map(int, raw_input().split())
for i in xrange(a):
	for j in xrange(w):
		mat[i][j] = 1
for i in xrange(b):
	for j in xrange(h):
		mat[j][i] = 1
ans = 0
for i in xrange(h):
	for j in xrange(w):
		ans += mat[i][j]
print h*w-ans

Submission status: Accepted

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

s = h*w
t = a*w
y = b*h-a*b
print(s-(t+y))