AtCoder Beginner Contest 106 - Garden

There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)

What is the area of this yard excluding the roads? Find it.

-----Note-----
It can be proved that the positions of the roads do not affect the area.

-----Constraints-----
 - A is an integer between 2 and 100 (inclusive).
 - B is an integer between 2 and 100 (inclusive).

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
Print the area of this yard excluding the roads (in square yards).

-----Sample Input-----
2 2

-----Sample Output-----
1

In this case, the area is 1 square yard.

Difficulty: EASY

Starter code:

Solutions:
(A, B) = map(int, input().split())
print(A * B - B - A + 1)


(a, b) = input().split()
print((int(a) - 1) * (int(b) - 1))


(A, B) = (int(X) for X in input().split())
print((A - 1) * (B - 1))


print(eval('~-' + '*~-'.join(input().split())))


(a, b) = map(int, input().split())
x = (a - 1) * (b - 1)
print(x)


(x, y) = map(int, input().split())
print(x * y - x - y + 1)


(a, b) = (int(_) for _ in input().split())
print((a - 1) * (b - 1))


(w, h) = map(int, input().split(' '))
print((w - 1) * (h - 1))


print(eval('(' + input().replace(' ', '-1)*(') + '-1)'))


(A, B) = [int(s) for s in input().split()]
print((A - 1) * (B - 1))


def mapt(fn, *args):
	return list(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(a, b) = Input()
	print((a - 1) * (b - 1))
main()


(a, b) = map(int, input().split())
sum = (a - 1) * (b - 1)
print(sum)


(a, b) = list(map(int, input().split()))
print((a - 1) * (b - 1))


(a, b) = map(int, input().split())
print(~-a * ~-b)


(a, b) = map(int, input().split())
c = a * b - (a + b - 1)
print(c)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
(a, b) = inm()
print(a * b - 1 * a - 1 * b + 1)


(a, b) = map(int, input().split())
print(str((a - 1) * (b - 1)))


(N, Y) = input().split()
n = int(N)
y = int(Y)
print(n * y - n - y + 1)


(a, b) = (int(i) for i in input().split())
print(a * b - a - b + 1)


(a, b) = input().split()
A = int(a)
B = int(b)
print((A - 1) * (B - 1))


X = list(map(int, input().split()))
print((X[0] - 1) * (X[1] - 1))


(x, y) = [int(x) for x in input().split()]
print((x - 1) * (y - 1))


a = input().split()
print((int(a[0]) - 1) * (int(a[1]) - 1))


(a, b) = [int(x) for x in input().split()]
print((a - 1) * (b - 1))


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inm = lambda : map(int, sys.stdin.readline().split())
inl = lambda : list(inm())
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
(A, B) = inm()
print(A * B - A - B + 1)


(n, m) = list(map(int, input().split()))
print((n - 1) * (m - 1))


(row, col) = map(int, input().split())
print((row - 1) * (col - 1))


(A, B) = list(map(int, input().split()))
C = (A - 1) * (B - 1)
print(C)


(a, b) = map(int, input().split())
s = a * b - a - b + 1
print(s)


(B, C) = map(int, input().split())
print((B - 1) * (C - 1))


s = input().split()
(a, b) = (int(s[0]), int(s[1]))
print(a * b - a - b + 1)


(X, Y) = map(int, input().split())
ans = X * Y - (X + Y - 1)
print(ans)


print(eval('~-' + input().replace(' ', '*~-')))


(A, B) = map(int, input().split())
C = A - 1
D = B - 1
E = C * D
print(E)


(n, m) = map(int, input().split())
k = (n - 1) * (m - 1)
print(k)


(a, b) = map(int, input().split())
res = (a - 1) * (b - 1)
print(res)


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


(A, B) = list(map(int, input().split()))
ans = A * B - (A + B - 1)
print(ans)


(a, b) = map(int, input().split())
m = a * b - a - b + 1
print(int(m))


(A, B) = [int(i) for i in input().split()]
print(A * B - A - B + 1)


(a, b) = tuple(map(int, input().split()))
print((a - 1) * (b - 1))


def main():
	(a, b) = list(map(int, input().split()))
	print((a - 1) * (b - 1))

def __starting_point():
	main()
__starting_point()


(X, t) = map(int, input().split())
print((X - 1) * (t - 1))


(A, B) = (int(x) for x in input().split())
menseki = A * B
nyan = menseki - A - B + 1
print(nyan)


(a, b) = map(int, input().split())
ans = a * b - a - b + 1
print(ans)


(A, B) = (int(x) for x in input().split())
print((A - 1) * (B - 1))


(len_a, len_b) = list(map(int, input().split()))
total_area = len_a * len_b
road = len_a + len_b - 1
print(total_area - road)


a = list(map(int, input().split()))
print((a[0] - 1) * (a[1] - 1))


num = input().split()
print((int(num[0]) - 1) * (int(num[1]) - 1))


(N, i) = map(int, input().split())
print((N - 1) * (i - 1))


(a, b) = map(int, input().split())
S = a * b - (a + b - 1)
print(S)


ab = input().split()
print((int(ab[0]) - 1) * (int(ab[1]) - 1))


(A, B) = (int(_) for _ in input().split())
print((A - 1) * (B - 1))


(a, b) = map(int, input().split())
num = a * b - a - b + 1
print(num)


(r, c) = map(int, input().split())
res = (r - 1) * (c - 1)
print(res)


(M, N) = [int(x) for x in input().split()]
print((M - 1) * (N - 1))


(S, T) = map(int, input().split())
print(~-S * ~-T)


A = list(map(int, input().split()))
print((A[0] - 1) * (A[1] - 1))


(A, B) = map(lambda x: int(x) - 1, input().split())
print(A * B)


(N, M) = [int(i) for i in input().split()]
print(N * M - N - M + 1)


(a, b) = map(int, input().split())
blank = a + b - 1
print(a * b - blank)


(N, M) = map(int, input().split())
print(N * M - N - M + 1)


(a, b) = sorted(map(int, input().split()))
print(a * b - a - b + 1)


(n, i) = map(int, input().split())
print((n - 1) * (i - 1))


(a, b) = map(int, input().split())
print((a - 1) * (b - 1))
exit(0)


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	(A, B) = list(map(int, readline().split()))
	print((A - 1) * (B - 1))
	return

def __starting_point():
	main()
__starting_point()


(N, K) = map(int, input().split())
print((N - 1) * (K - 1))