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

# H = 2
# W = 4
#
# h = 1
# w = 3

h -= 1
w -= 1

panel = [[1] * W for i in range(H)]

cnt = H * W
for x in range(0, H):
    for y in range(0, W):
        if x <= h or y <= w:
            if 0 < panel[x][y]:
                panel[x][y] = 0
                cnt -= 1

# print(panel)
print(cnt)

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:
#!/usr/bin/env python3
import sys
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(H: int, W: int, h: int, w: int):
    return (H - h ) * (W - w)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    h = int(next(tokens))  # type: int
    w = int(next(tokens))  # type: int
    result = solve(H, W, h, w)
    print(result)

if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sei(a):
  v=[]
  for i in a.split():
    v+=[int(i)]
  return v
a=sei(input())
b=sei(input())
ans=a[0]*a[1]-b[0]*a[1]-(b[1]*a[0]-b[0]*b[1])
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()))
print((H-h)*(W-w))

Submission status: Accepted

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

white_cells_int = H * W - ((h * W) + (w * H) - (h * w))
print(str(white_cells_int))

Submission status: Accepted

Solution code:
fh, fw = map(int, input().split())
ch, cw = map(int, input().split())

white = fh*fw - ch*fw - cw*(fh-ch)

print(white)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
h0, w0 = map(int,input().split(' '))
h1, w1 = map(int, input().split(' '))
print((h0-h1)*(w0-w1))

Submission status: Accepted

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

val = H * (W - w)
dis = h*(W-w)
val = val - dis
print(val)

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

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


h, w = inl()
h2, w2 = inl()

print(h * w - h2*w - w2*h + h2*w2)

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

H = max(0, H-h)
W = max(0, W-w)
print(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
from sys import stdin
H,W = map(int,stdin.readline().rstrip().split())
h,w = map(int,stdin.readline().rstrip().split())
print(H*W-(h*W+H*w-h*w))

Submission status: Accepted

Solution code:
in1 = input().split()
in2 = input().split()

H = int(in1[0])
W = int(in1[1])

h = int(in2[0])
w = int(in2[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

H = int(input1[0])
W = int(input1[1])
h = int(input2[0])
w = int(input2[1])

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

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

Submission status: Accepted

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

alln = H*W
blan = h*W + w*H - h*w

print(alln-blan)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# ABC121A - White Cells
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 = [int(c) for c in input().split()]

h, w = [int(c) for c in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
z = list(map(int,input().split()))
s = list(map(int,input().split()))

print( z[0]*z[1] - ((s[0]*z[1] + s[1]*z[0]) - (s[0]*s[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:
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:
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((W-w)*(H-h))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    arr1 = input()
    arr1 = list(map(int, arr1.split()))
    arr2 = input()
    arr2 = list(map(int, arr2.split()))
    H = int(arr1[0])
    W = int(arr1[1])
    h = int(arr2[0])
    w = int(arr2[1])
    print((H-h)*(W-w))

main()

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

x=a[0]*a[1]
y=b[0]*b[1]

res=x - ((a[0]*b[1])+(a[1]*b[0])) + y
print(res)

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

Submission status: Accepted

Solution code:
# A - White Cells
# https://atcoder.jp/contests/abc121/tasks/abc121_a

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

print '{}'.format(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())

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

print(ans)

Submission status: Accepted

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

c=h*W+(w*(H-h));

print(H*W-c)

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 -h*w

ans = white - black
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()]

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

Submission status: Accepted

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

#入力
H, W = map(int, raw_input().split())
h, w = map(int, raw_input().split())

shiro = H * W

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

nokori = shiro - kuro

print(nokori)

Submission status: Accepted

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

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

print(n)

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

Submission status: Accepted

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

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 + (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 = 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:
listA = [] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;

H = listA[0][0]
W = listA[0][1]
h = listA[1][0]
w = listA[1][1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in sys.stdin.readline().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    H, W = li_input()
    h, w = li_input()

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

    print(S)


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

full_cells = HHH * WWW

full_cells -= h * WWW

full_cells -= ((w * HHH) - (h * w))

print(full_cells)

Submission status: Accepted

Solution code:
#A - White Cells

import numpy as np

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

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

total = int(np.sum(Orig))
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8
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:
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:
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 -h*W +h*w)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
HW = [int(i) for i in input().split()]
hw = [int(i) for i in input().split()]

output = (HW[0] - hw[0]) * (HW[1] - hw[1])

print(output)

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

Submission status: Accepted

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

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

print(output)

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

Submission status: Accepted

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

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:
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 = tuple([int(x) for x in input().split(' ')])
h, w = tuple([int(x) for x in 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())
result=(a*b)-(c*b+(a-c)*d)
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:
row, col = map(int, input().split(' '))
p_row, p_col = map(int, input().split(' '))
print((row - p_row) * (col - p_col))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
HW = raw_input().split()
hw = raw_input().split()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_1 = input().split()

h_l = int(input_1[0])
w_l = int(input_1[1])

input_2 = input().split()

h = int(input_2[0])
w = int(input_2[1])

result = h_l * w_l - (h_l * w  + w_l * h) + w * h

print(result)

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

gou = x -a 
retu = y - b
print(gou*retu)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(H: int, W: int, h: int, w: int):
    print((H - h) * (W - w))
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    h = int(next(tokens))  # type: int
    w = int(next(tokens))  # type: int
    solve(H, W, h, w)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    H, W = [int(x) for x in input().split()]
    h, w = [int(x) for x in input().split()]
    wh, ww = H - h, W - w
    print(wh * ww)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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:
H, W = map(int, input().split())
h, w = map(int, input().split())
HM = H * W
hW = W * h
h1 = H - h
h2 = h1 * w
h3 = HM - hW - h2
print(h3)

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

yy = x * _y
xx = (y-_y) * _x
z = yy + xx
print((y*x) - z)

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

Submission status: Accepted

Solution code:
# coding: utf-8

S = input().rstrip().split(' ')
s = input().rstrip().split(' ')

C = int(S[0])
c = int(s[0])
R = int(S[1])
r = int(s[1])

a = C*R - (r*C+(R-r)*c)

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W = [ int(unko) for unko in input().split()]
h,w = [ int(unko) for unko in input().split()]
if 1 <= H and W <= 20:
    if 1 <= h <= H:
        if 1 <= w <= W:
            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())
print(h*w-((hh*w)+(ww*h)-(hh*ww)))

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 - h1)* (w0 - w1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
H,W = map(int,input().rstrip().split())
h,w = map(int,input().rstrip().split())
cells = [[1]*W]*H
cells = cells[h:]
cells = list(zip(*cells))
cells = cells[w:]
print(sum(list(map(sum,list(zip(*cells))))))

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

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

Submission status: Accepted

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

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())
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:
x,y = input().split(),input().split()
h,w,hh,ww = int(x[0]),int(x[1]),int(y[0]),int(y[1])
print((h - hh) * (w - ww))

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

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(H, W, h, w):
    return (H - h) * (W - w)


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
m=input().split()
n=input().split()
a=int(m[0])
b=int(m[1])
c=int(n[0])
d=int(n[1])
s=a*b
x=s-b*c-a*d+c*d
print(x)

Submission status: Accepted

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

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

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:
import numpy as np
H, W = (int(x) for x in input().split())
h, w = (int(x) for x in input().split())
board = np.tile([0],(H,W))

def Counting(b):
    ret = 0
    for i in range(H):
        for j in range(W):
            if b[i][j] == 0:
                ret += 1
    return ret

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

print(Counting(board))

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