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:
import sys
input = sys.stdin.readline
h,w = input().split()
h2,w2 = input().split()
h = int(h)
w = int(w)
h2 = int(h2)
w2 = int(w2)
print((h - h2) * (w - w2))

Submission status: Accepted

Solution code:
#!venv/bin/python

import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 

N,W = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]

print (N * W - (h * W + w * N - 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())
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(max(0,(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())
ans =(H-h)*(W-w)
print(ans)

Submission status: Accepted

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

#C

#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:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_list_of_int():
    return [int(i) for i in input().split()]


def get_list_of_float():
    return [float(f) for f in input().split()]


def get_list_of_char():
    return list(input().strip())


def get_data(n, order=None, **kwargs):
    if not order:
        order = range(len(kwargs))
    it = iter(order)
    var, fn = zip(*sorted(sorted(kwargs.items()), key=lambda _: next(it)))

    rows = []
    for _ in range(n):
        rows.append(input().split())
    columns = zip(*rows)
    exec("global "+", ".join(var)+"\n"+"\n".join(
        v+"=list(map(fn[{}], data[{}]))".format(i, i)
        for i, v in enumerate(var)),
        globals(),
        {"fn": list(fn), "data": list(columns)}
    )
    return


# inputs
H, W = 0, 0
h, w = 0, 0


def set_inputs():
    global H, W, h, w
    H, W = get_list_of_int()
    h, w = get_list_of_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    print((H - h) * (W - w))
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from itertools import chain
from functools import reduce
from collections import OrderedDict, Counter, deque
import operator

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

Submission status: Accepted

Solution code:
#A問題
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()))
hh, ww = list(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(h*w - h*w_ - h_*w +h_*w_)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

n, m = map(int,input().split())
s, t = map(int,input().split())

k = (n-s)*(m-t)

print(k)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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:
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
#以下てんぷら
def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())
#n = ip()                                     #入力整数1つ
h,w= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
x,y= (int(i) for i in input().split())
print((h-x)*(w-y))

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

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

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

Submission status: Accepted

Solution code:

A, B = map(int, input().split())
A2, B2 = map(int, input().split())

print((A-A2)*(B-B2));

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

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

Submission status: Accepted

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

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

Submission status: Accepted

Solution code:
# N = int(input())
H, W = map(int, input().split())
h, w = map(int, input().split())
# a = list(map(int, input().split()))
# p, *a = map(int, input().split())
# print(p, "\n", a)
print((H-h)*(W-w))

Submission status: Accepted

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

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

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

h, w = na()
hh, ww = na()
print((h-hh)*(w-ww))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

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

H=H1-H2
W=W1-W2

print(HW)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
3 2
2 1

Submission status: Runtime Error

Solution code:
N, M = map(int,input().split())
P = [input().split() for i in range(N)]
P.sort()

j = 0
total = 0

for i in range(N):
  if (j + int(P[i][1])) < M:
    total += int(P[i][0]) * int(P[i][1])
    j += int(P[i][1])
  else:
    total += int(P[i][0]) * (M - j)
    break
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
def inpl(): return list(map(int, input().split()))
N, M, C = inpl()
B = np.array(inpl(), dtype=np.int64)
ans = 0
for _ in range(N):
    A = np.array(inpl(), dtype=np.int64)
    ans += np.sum(A*B)+C > 0
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
print(2*x*3.14)

Submission status: Runtime Error

Solution code:
x = map(int, input().split())
print(2*x*3.14)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, m, c = rm()
b = np.array(rl())
cnt = 0
for _ in range(n):
  a = np.array(rl())
  if np.sum(a*b) > -c:
    cnt += 1
print(cnt)

Submission status: Runtime Error

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: Runtime Error

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

 print(max(H*W-h*W-(H-h)*w,0))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N)
    A = list(map(int, input().split()))

for i in range(M):
    calc = A[i] * B[i]
    if C + calc > 0:
        count+=1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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)

import math
a, b , h, m = map(int, input().split())
xa = a * math.sin(h/6*math.pi)
ya = a * math.cos(h/6*math.pi)
xb = b * math.sin(m/30*math.pi)
yb = b * math.cos(m/30*math.pi)
print(math.sqrt((xa-xb)**2 + (ya-yb)**2))
a,b = MII()
h,w = MII()
print((a-h)*(b-w))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC121A

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(after_masume)

Submission status: Runtime Error

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

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

print(afrer_masume)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<math.h>
#include<iomanip>
#include<functional>
using namespace std;

#define ll long long
using vt = ll; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define all(v) v.begin(), v.end()
#define P pair<ll, ll>
const ll  MOD = 1000000007;

int main() {
	ll H, W, h, w;
	cin >> H >> W >> h >> w;
	cout << (H - h) * (W - w);
	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
array=[]
cost=0
for i in range(n):
    a,b=map(int,input().split())
    array.append([a,b])
array.sort()
for i in array:
    if m<=i[1]:
        cost+=i[0]*m
    else:
        cost+=i[0]*i[1]
        m-=i[1]
        
print(cost)

Submission status: Runtime Error

Solution code:
N, M, C = list(map(int, input().split()))
b = list(map(int, input().split()))
count = 0

for i in range(N):
    a = list(map(int, input().split()))
    add = 0
    for j in range(M):
        add += a[j] * b[j]

    if add + C > 0:
        count += 1

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
l = input().split(" ")
s = input().split(" ")

H = int(l[0])
W = int(l[1])
h = int(s[0])
w = int(s[1])

print(HW-(wH + hW - wh))

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
p=[list(map(int,input().split()) for i in range(2))]

(p[0][0]-p[1][0])*(p[0][1]-p[1][1])

Submission status: Runtime Error

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

(p[0][0]-p[1][0])*(p[0][1]-p[1][1])

Submission status: Runtime Error

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

return H*W-h*W-w*H+h*w

Submission status: Runtime Error

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

return H*W-h*W-w*H+h*w

Submission status: Runtime Error

Solution code:
H,W = map(int,input())
r,c = map(int,input())

import numpy as np

matrix = np.ones((H,W),dtype="uint8")
matrix[0:r,:] = 0
matrix[:,0:c] = 0
print(matrix.sum())

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def print_ans(H, W, h, w):
    """Test Case
    >>> print_ans(3, 2, 2, 1)
    1
    >>> print_ans(5, 5, 2, 3)
    6
    >>> print_ans(2, 4, 2, 4)
    0
    """
    print((H - h) * (W  -w))


if __name__ == '__main__':
    H, W = map(int, input().rstrip().split())
    h, w = map(int, input().rstrip().split())
    print_ans(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()

aa=int(a)
bb=int(b)
cc=int(c)
dd=int(d)
print (aa*bb-(bb*cc+aa*dd-cc*dd))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:

def to_bin(n):
  s = ''
  while n > 0:
    s += str(n%2)
    n //= 2
  return s[::-1]

def xor(s1, s2):
  s1 = '0'*(len(s2)-len(s1)) + s1
  result = ''
  for i in range(len(s1)):
    if s1[i] == s2[i]:
      result += '0'
    else:
      result += '1'
  return result

def to_den(s):
  s = s[::-1]
  total = 0
  for i in range(0, len(s)):
    total += 2**i*int(s[i])
  return total

def main():
  A, B = map(int, input().split())
  if A == B:
    print(A)
    exit(1)

  cur = xor(to_bin(A), to_bin(A+1))

  for i in range(A+2, B+1):
    s = to_bin(i)
    cur = xor(cur, s)

  print(to_den(cur))

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H,W=(int,input().split())
h,w=(int,input().split())
S=H*W
print(S-(H*w+W*h)+w*h)
#どうやっても想定と違う値が出る　後で考え直す

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

>>> main([3, 2], [2, 1])
1
>>> main([5, 5], [2, 3])
6
>>> main([2, 4], [2, 4])
0'''


def main(amount, portion):
    print((amount[0] - portion[0]) * (amount[1] - portion[1]))


if __name__ == "__main__":
    amount = map(int, input().split(' '))
    portion = map(int, input().split(' '))

    main(amount, portion)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = (int(x) for x in input().split())
result = {}
result_num = ''
 
if A == B:
  print(A)
else:
  for i in range(A,B+1):
    two = format(i, 'b')
    count = 0
    for item in reversed(two):
      if result.get(count) != None:
        result[count] += int(item)
      else:
        result[count] = 0
        result[count] += int(item)
      count += 1
 
  for i in result:
    if result[i] % 2 == 1:
      result_num += '1'
    else:
      result_num += '0'
 
  result_num = result_num[::-1]
  print(int(result_num, 2))

Submission status: Runtime Error

Solution code:
length, width = int(input()).split()
x, y = int(input()).split()

print((length-x) * (width-y))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = [0]*N
B = [0]*N
for i in range(N):
  A[i], B[i] = map(int, input().split())
  
for i in range(N):
  A.insert(2*i+1, B[i])

C = [A[i:i + 2] for i in range(0, len(A), 2)]
C = sorted(C, key=lambda x:(x[0],-x[1]))

hon = 0
kane = 0
for i in range(N):
  if C[i][1] + hon <= M:
    hon += C[i][1]
    kane += C[i][0] * C[i][1]
  else:
    kane += (M - hon) * C[i][0]
    break

print(kane)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for k in range(n)]
 
count=0
 
for i in range(n):
  absum=0
  for j in range(m):
    absum +=a[i][j]*b[j]
   
  ans=absum+c
  if ans>0:
    count+=1
      
print(count)

Submission status: Runtime Error

Solution code:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for k in range(n)]
 
count=0
 
for i in range(n):
  absum=0
  for j in range(m):
    absum+=a[i][j]*b[j]
    
    ans=absum+c
    if ans>0:
      count+=1
      
print(count)

Submission status: Runtime Error

Solution code:
H,W = map(int, input().split())
h,w = map(int, input().split())
print(HW-hW-Hw+hw)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split()]
pre_lst=[]
for i in range(N):
  pre_lst.append([int(s) for s in input().split()])
lst = sorted(pre_lst, key=lambda x: x[0])
count=0
cost=0
for e in lst:
  count+=e[1]
  cost+=e[0]*e[1]
  if(count>=M):
    cost-=e[0]*(count-M)
    break
print(cost)

Submission status: Runtime Error

Solution code:
N,M = [int(s) for s in input().split()]
lst = []

for i in range(N):
  lst = lst + [[int(s) for s in input().split()]]

lst.sort()
n = 0
cost = 0

for e in lst:
    n += e[1]
    cost += e[0] * e[1]
    if n >= M:
        break

if n > M:
  cost -= lst[i][0] * (n - M)

print(cost)

Submission status: Runtime Error

Solution code:
n, m = map(lambda x: int(x), input().split())
drinks = []
for _ in range(n):
    a, b = map(lambda x: int(x), input().split())
    drinks.append((a, b))
    
sorted_drinks = sorted(drinks, key=lambda x: x[0])

num_drinks = 0
sum_prices = 0
for price, num in sorted_drinks:
    num_drinks += num
    sum_prices += num * price
    if num_drinks > m:
        sum_prices -= (num_drinks - m) * price
        break
    elif num_drinks == m:
        break

print(sum_prices)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H, W=int(HW[0]),int(HW[1])
h, w=int(hw[0]),int(hw[1])
ans=(W-w)*(H-h)
print(ans)

Submission status: Runtime Error

Solution code:
H, W=int(HW[0]),int(HW[1])
h, w=int(hw[0]),int(hw[1])
print((W-w)*(H-h))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))

count = 0
for i in range(0, n):
    a = list(map(int, input().split()))
    s = 0
    for j in range(0, m):
        s += a[j] * b[j]
    if s + c > 0:
        count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H,W=gets.chomp.split(" ").map{|s| s.to_i}
h,w=gets.chomp.split(" ").map{|s| s.to_i}
puts H*W-H*w-W*h+w*h

Submission status: Runtime Error

Solution code:
(H-h) * (W-w)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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