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:
rr = lambda: input().strip()
rrm = lambda: list(map(int, rr().split()))

R, C = rrm()
Rx, Cx = rrm()
A = [[True] * C for _ in range(R)]
for r in range(Rx):
    A[r] = [False] * C
for c in range(Cx):
    for r in range(R):
        A[r][c] = False

print(+sum(sum(row) for row in A))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

s=np.zeros((H,W))
for i in range(h):
    for j in range(W):
        s[i][j]=-1
for i in range(w):
    for j in range(H):
        s[j][i]=-1
        
count=0
for i in range(H):
    for j in range(W):
        if s[i][j]==0:
            count+=1
print(count)

Submission status: Accepted

Solution code:
import numpy as np

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

ones_h = np.ones((h, W, ))
zero_h = np.zeros((H-h, W, ))
sum_h = np.vstack([ones_h, zero_h])

ones_w = np.ones((H, w, ))
zero_w = np.zeros((H, W-w, ))
sum_w = np.hstack([ones_w, zero_w])


sum_result = sum_h + sum_w

print(np.sum(sum_result==0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
math_line = list(map(int,input().split()))
input_line = list(map(int,input().split()))

area = math_line[0]*math_line[1]
black_cell = math_line[0]*input_line[1] + math_line[1]*input_line[0]
duplicate =  black_cell - input_line[0]*input_line[1]
white_cell = area - duplicate

print(white_cell)

Submission status: Accepted

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

s = int(h*w)

print((s - (hh*w+ww*h))+hh*ww)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- conding: utf-8 -*-

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

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

Submission status: Accepted

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

    sum_cell = H * W
    v_sel = h * W
    h_sel = w * H
    dupli = h * w

    while_cell = sum_cell - (v_sel + h_sel - dupli)

    print(while_cell)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
input_list = [list(map(int, input().split())) for _ in range(2)]
x = input_list[0][0] - input_list[1][0]
y = input_list[0][1] - input_list[1][1]
print(x * y)

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

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

Submission status: Accepted

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

r,c = map(int,input().split(" "))

tot_cells = h*w

painted_cells = r*w + c*h - (r*c)

print(tot_cells-painted_cells)

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:
n,m = [int(i) for i in input().split()]
h,w= [int(i) for i in input().split()]
print((n-h)*(m-w))

Submission status: Accepted

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

dh = H - h
dw = W - w
area = dh * dw
print(area)

Submission status: Accepted

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

Submission status: Accepted

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(int(np.sum(matrix)))

Submission status: Accepted

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

if H - h == 0 and W -w == 0:
    print("0")
else:
    print(abs((H - h)* (W - w)))

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

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    h, w = LI()
    a, b = LI()
    return (h - a) * (w - b)


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

import numpy as np

A = [list(map(int, input().split())) for _ in range(2)]
A = np.array(A)
B = A[0,]-A[1,]
ANS = B[0]*B[1]
print(ANS)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

# A問題
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 = [int(i) for i in input().split()] 
b = [int(i) for i in input().split()] 


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

Submission status: Accepted

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

A, B = list(map(int, input().split()))

a, b = list(map(int, input().split()))

print((A - a) * (B - b))

Submission status: Accepted

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

f = (a-c)*(b-d)

if f <= 0 :
    print(0)
else:
    print(f)

Submission status: Accepted

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

print(a*b-c*b-a*d+c*d)

Submission status: Accepted

Solution code:
#入力
H,W=map(int,input().split())
h,w=map(int,input().split())
#計算
B_cells=h*W+w*H-h*w #黒色のマス目の数
W_cells=H*W-B_cells #白色のマス目の数
#出力
print(W_cells)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    RW = list(map(int, input().split()))
    rw = list(map(int, input().split()))
    print(RW[0]*RW[1] - (RW[1]*rw[0] + RW[0]*rw[1]) + rw[0]*rw[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def a(input_string):
    one, two = input_string
    H, W = [int(x) for x in one.split()]
    h, w = [int(x) for x in two.split()]
    all_one_matrix = []
    for i in range(H):
        all_one_matrix.append([])
        for j in range(W):
            all_one_matrix[i].append(1)
    for i in range(h):
        for j in range(len(all_one_matrix[i])):
            all_one_matrix[i][j] = 0
    for i in range(len(all_one_matrix)):
        for j in range(len(all_one_matrix[i])):
            if j in range(w):
                all_one_matrix[i][j] = 0
    count_0 = 0
    for i in range(H):
        for j in range(W):
            if all_one_matrix[i][j] == 1:
                count_0 += 1
    return count_0


def main():
    input_line = stdin.readlines()
    answer = a(input_line)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
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 = [int(_) for _ in input().split()]
h, w = [int(_) for _ in input().split()]
print((H-h)*(W-w))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:07:57 2019

@author: iwata
"""

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

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

Submission status: Accepted

Solution code:
def read():
  return int(input())

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

H, W = reads()
h, w = reads()
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))

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
GR=input().split()
G2R2=input().split()
G=int(GR[0])
R=int(GR[1])
G2=int(G2R2[0])
R2=int(G2R2[1])
print(str(G*R-(G2*R+R2*G-G2*R2)))

Submission status: Accepted

Solution code:

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

li=[]
for i in range(N):
    li.append(list(map(int,input().split())))
'''

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

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

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

result = h*w  - w*h2 - (h-h2)*w2
print(result)

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

Submission status: Accepted

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

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

input_line = input().split(" ")
draw = input().split(" ")

white = (int(input_line[0]) - int(draw[0])) * (int(input_line[1]) - int(draw[1]))

print(white)

Submission status: Accepted

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

print(retu*W-gyo)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
s,t = map(int,input().split())

print((x*y)-((s*y) + ((x-s)*t)))

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

Submission status: Accepted

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[1][0]) *  (list[0][1] - list[1][1])
    print(a)

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

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:
N = [list(map(int,input().split())) for i in range(2)]
print( (N[0][0] - N[1][0])*(N[0][1] - N[1][1]) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

lst = [[0]*W for _ in range(H)]

for i in range(h):
    for j in range(W):
        lst[i][j] = 1
        
for i in range(H):
    for j in range(w):
        lst[i][j] = 1

ans = 0

for i in range(H):
    for j in range(W):
        if lst[i][j] == 0:
            ans += 1
            
print(ans)

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
import numpy as np
H, W = map(int, raw_input().split())
h, w = map(int, raw_input().split())

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

for i in range(0, h):
    for j in range(0, W):
        array[i][j] += 1

for i in range(0, w):
    for j in range(0, H):
        array[j][i] += 1

count = 0
for i in range(0, H):
    for j in range(0, W):
        if array[i][j] == 0 : count += 1

print count

Submission status: Accepted

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

a, b = input().split()
a = int(a)
b = int(b)

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

Submission status: Accepted

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

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())
hh,ww = map(int,input().split())
A = h*w
b = hh*w+ww*(h-hh)
res = A -b
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

ans=[[0]*W for _ in range(H)]

for hh in range(h):
    for i in range(W):
        ans[hh][i]=1
for ww in range(w):
    for i in range(H):
        ans[i][ww]=1

sums=0
for ll in ans:
    sums+=sum(ll)

print(H*W-sums)

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
inp = [input() for _ in range(2)]
H, W = inp[0].split(" ")
h, w = inp[1].split(" ")
H = int(H)
W = int(W)
h = int(h)
w = int(w)
outp = H * W - h * W - H * w + h * w
print(outp)

Submission status: Accepted

Solution code:
def main():
    H, W = map(int, input().split())
    s_h, s_w = map(int, input().split())
    all_m = H * W
    del_h = s_h * W
    del_w = s_w * H
    zyu_huku = s_h * s_w
    nuri = (del_h + del_w) - zyu_huku
    remain = all_m - nuri
    print(remain)


if __name__ == '__main__':
    main()

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:
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(int(np.sum(table)))

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

import sys

def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
 
    tokens = lines[0].split(" ")
    width = int(tokens[0])
    height = int(tokens[1])
    tokens = lines[1].split(" ")
    w = int(tokens[0])
    h = int(tokens[1])

    return (width, height, w, h)


def solve(width, height, w, h):


    return (width - w) * (height - h)

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 19:52:16 2019

@author: USER
"""

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

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

print(ans)

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

menseki = H * W
kaburi = h * w
a = H * w
b = W * h

x = a + b - kaburi
print(menseki - x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inData1 = input().split(' ')
inData2 = input().split(' ')
sMasu = int(inData1[0]) * int(inData1[1])

sMasu -= int(inData1[1]) * int(inData2[0])
sMasu -= (int(inData1[0]) - int(inData2[0])) * int(inData2[1])

print(sMasu)

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
a,b = map(int,input().split())
sums = H*b+W*a
sa = a*b
anser = (H*W)-(sums-sa)
print(anser)

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

print( (A-a)*(B-b))

Submission status: Accepted

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

a=0
b=0

a=h*W
b=(w*H)-(h*w)

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

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

Submission status: Accepted

Solution code:
a = input().split()
b = input().split()

H = int(a[0])
W = int(a[1])
h = int(b[0])
w = int(b[1])

gridAll = H*W
gridRemain = gridAll

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

print(gridRemain)

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
h,w=map(int,input().split())
white1=h*W #横に塗りつぶす数。
white2=w*(H-h)#縦に塗りつぶす数。

print(H*W-white1-white2)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[int(x)for x in input().split()]
c,d=[int(x)for x in 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:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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:
h, w = map(int, input().split())
Height, Width = map(int, input().split())
print(h*w - Height*w - Width*(h - Height))

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

Solution code:
base_row, base_cul = (int(i) for i in input().split())
row, cul = (int(i) for i in input().split())

all = base_row * base_cul

# print(all)

row_deli = row * base_cul

# print(row_deli)

col_deli = cul * base_row

# print(col_deli)

jufuku = row * cul

# print(jufuku)

# print(row_deli + col_deli - jufuku)

print(all - (row_deli + col_deli - jufuku))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h0,w0=[int(i) for i in input().split()]
h1,w1=[int(i) for i in input().split()]
print(h0*w0-h1*w0-w1*h0+h1*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 - h*w))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import collections
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*W - h*W - H*w + h*w
print(ans)

Submission status: Accepted

Solution code:
def A():
    HW = input().split()
    H = int(HW[0])
    W = int(HW[1])
    hw = input().split()
    h = int(hw[0])
    w = int(hw[1])
    print( (H-h) * (W-w) )
    return 

if __name__ == '__main__':
    A()

Submission status: Accepted

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

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

A = h * W
B = H * w

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
h,w = LI()
y,x = LI()
print(h*w-h*x-w*y+y*x)
#B
"""
n,m,c = LI()
b = LI()
a = LIR(n)
ans = 0
for i in range(n):
    d = c
    for k in range(m):
        d += b[k]*a[i][k]
    if d > 0:
        ans += 1
print(ans)
"""


#C

"""
n,m = LI()
v = LIR(n)
v.sort(key = lambda x:x[0])
ans = 0
k = 0
for a,b in v:
    if k+b >= m:
        ans += (m-k)*a
        print(ans)
        quit()
    ans += b*a
    k += b
"""
#D
#a,b = LI()

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
print(x[0]*x[1]-(x[0]*y[1]+x[1]*y[0]-y[0]*y[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)))

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

Submission status: Accepted

Solution code:
a = input().split()
b = input().split()

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
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(' '))

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- Coding: utf-8 -*-


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:
inp1 = input().split(' ')
inp1 = [int(i) for i in inp1]
inp2 =  input().split(' ')
inp2 = [int(i) for i in inp2]

H, W = inp1[0], inp1[1]
h, w = inp2[0], inp2[1]

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

Submission status: Accepted

Solution code:
l=[[int(j) for j in input().split()] for i in range(2)]
print(l[0][0]*l[0][1] - l[1][0]*l[0][1] - l[1][1]*l[0][0] + l[1][0]*l[1][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())

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# abc121_a
"""
White Cells
"""

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 = [int(_) for _ in input().split()]
h, w = [int(_) for _ in input().split()]

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

Submission status: Accepted

Solution code:
tmp = [int(i) for i in raw_input().split()]
tmp2 = [int(i) for i in raw_input().split()]

all = tmp[0]*tmp[1]
A = tmp[1]*tmp2[0]

B = tmp[0]*tmp2[1]

C = B - tmp2[0]*tmp2[1]

print(all - A - C)

Submission status: Accepted

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


def main():
    print(H * W - h * W - w * H + h * w)
    return


main()

Submission status: Accepted

Solution code:
tate,yoko = map(int,input().split())
tate_hiku,yoko_hiku = map(int,input().split())
zenbu = tate*yoko
tate_hiku_zenbu = tate_hiku*yoko
yoko_hiku_zenbu = yoko_hiku*tate
kasanari = tate_hiku*yoko_hiku
print(zenbu-tate_hiku_zenbu-yoko_hiku_zenbu+kasanari)

Submission status: Accepted

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

Submission status: Accepted

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

a = HW[0]*HW[1]
b = HW[0]*hw[1] + HW[1]*hw[0]
c = hw[0] * hw[1]
print(a-b+c)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
H,W = map(int,input().split())
h,w = map(int,input().split())
data = np.ones([H,W])
for i in range(h):
  data[i,:]=0
for i in range(w):
  data[:,i]=0

print(int(data.sum()))

Submission status: Accepted

Solution code:
import sys

a = list(map(int, input().split()))
H = a[0]
W = a[1]

a = list(map(int, input().split()))
h = a[0]
w = a[1]


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