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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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_1, w_1 = map(int, input().split())
h_2, w_2 = map(int, input().split())

ans = (h_1 - h_2) * (w_1 - w_2)
print(ans)

Submission status: Accepted

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

a = h*W
b = H*w
c = h*w

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
n = input()
n1 = input()
m = re.search('(\d+)\s(\d+)', n)
m1 = re.search('(\d+)\s(\d+)', n1)
a = int(m.group(1))
b = int(m.group(2))
c = int(m1.group(1))
d = int(m1.group(2))
ab = a * b
cd = c * b + d * (a - c)
print(ab - cd)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
box_size = list(map(int, input().split())) 
fill_num = list(map(int, input().split())) 
 
box = np.array([[1]*box_size[1]]*box_size[0])
for r in range(fill_num[0]):
    box[r,:] = 0
for c in range(fill_num[1]):
    box[:,c] = 0
print(np.sum(box))

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

# check
if (H, W) == (h, w):
    print(0)
else:
    print(H * W - ((W * h) + (H * w) - (h * w)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(max(H*W-h*W-w*(H-h),0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))
def P(s):
  return print(s)

a,b = MII()
h,w=MII()
P((a-h)*(b-w))

Submission status: Accepted

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

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

Submission status: Accepted

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

H_white = H - h
W_white = W - w

print(H_white * W_white)

Submission status: Accepted

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print((h-t)*(w-u))

Submission status: Accepted

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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    H, W = mi()
    a, b = mi()
    print((H-a) * (W-b))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
def main():
    H,W=L()
    h,w=L()
    print(H*W-h*W-(w*(H-h)))
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
stdin = open(0).read().split('\n')
H, W = map(int,stdin[0].split())
h, w = map(int,stdin[1].split())
print(H*W-H*w-h*W+h*w)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

H, W = Is()
h, w = Is()
print(H*W-h*W-H*w+h*w)

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


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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    H, W = map(int, input().split())
    h, w = map(int, input().split())
    ans = H * W - H * w - h * W + h * w
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

x = list(map(int,input().split()))

HW = X[0] * X[1]

h = X[1] * x[0]
w = (X[0] * x[1]) - (x[0] * x[1])

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

if __name__ == '__main__':

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(H, W, h, w))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    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:
H, W = map(int, input().split())
h, w = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

t=[[0]*W for i in [0]*H]

for i in range(h):
    for j in range(W):
        t[i][j]=1

for i in range(w):
    for j in range(H):
        t[j][i]=1

ans=0

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

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

Submission status: Accepted

Solution code:
H,W,h,w = map(int, open(0).read().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:
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:
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())

area = H * W
white = area - h * W - (H-h) * w
print(white)

Submission status: Accepted

Solution code:
a=map(int,open(0).read().split());a,b,c,d=a;print((a-c)*(b-d))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
# ABC121A

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

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:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

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

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:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

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

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

Submission status: Accepted

Solution code:
# A - White Cells

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:
def white_cells(H, W, h, w):

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import Counter
import itertools
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

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

Submission status: Accepted

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

masu = H * W
zan = masu -((h*W)+(w*(H-h)))
print(zan)

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:
x = input().split()
y = input().split()
H = int(x[0])
W = int(x[1])
h = int(y[0])
w = int(y[1])
white = (H * W) - ((h*W) + (w*H) - (h*w))
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 = map(int,input().split())
h,w = map(int,input().split())
TOTAL = H * W
total = (W * h + H * w)-h*w
result = TOTAL - total
print(result)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

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 sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()
h, w = MAP()
print(H*W - h*W - w*H + h*w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h ) * (W - w))

Submission status: Accepted

Solution code:
import numpy as np

H, W = map(int, input().split())
h, w = map(int, input().split())
table = np.ones((H, W), dtype='int')
table[:h,:] = 0
table[:,:w] = 0
num = np.sum(table)
print(num)

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

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

print(sum)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
h, w = lr()
answer = (H-h) * (W-w)
print(answer)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
h, w = lr()
answer = H * W + h * w - h * W - w * H
print(answer)
# 31

Submission status: Accepted

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

Submission status: Accepted

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

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

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