Problem:


Score : 100 points

Problem Statement

In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?

Constraints

2 ≤ n, m ≤ 100

Input

Input is given from Standard Input in the following format:

n m

Output

Print the number of blocks in K-city.

Sample Input 1

3 4

Sample Output 1

6

There are six blocks, as shown below:

Sample Input 2

2 2

Sample Output 2

1

There are one block, as shown below:



Sample input:
3 4


Sample output:
6

Submission status: Accepted

Solution code:
import sys

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("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

n, m = inl()


def solve():
    return (n - 1) * (m - 1)


print(solve())

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
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
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
import numpy as np
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

n, m = MAP()
print((n - 1) * (m - 1))

Submission status: Accepted

Solution code:
tmp = input().split(" ")
print((int(tmp[0]) - 1) * (int(tmp[1]) - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M = (int(T) for T in input().split())
print((N-1)*(M-1))

Submission status: Accepted

Solution code:
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():
    n, m = map(int, readline().split())

    print((n - 1) * (m - 1))

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = (n - 1) * (m - 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((n - 1) * (m - 1))

Submission status: Accepted

Solution code:
def main():
    n,m = map(int,input().split())
    print((n-1)*(m-1))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

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

print((n - 1)*(m - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = [int(x) for x in input().split()]
print((n - 1) * (m - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def LI(): 
    return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

n,m = LI()

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

n,m = LI()

print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = (int(x) for x in input().split())
print ((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
print((a-1)*(b-1))

Submission status: Accepted

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

print((n-1) * (m-1))

Submission status: Accepted

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

Submission status: Accepted

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

ans = (n-1)*(m-1)
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

n,m = I()
print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((a - 1) * (b - 1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n,m = map(int,input().split())
if n < 2 or m < 2 or n > 100 or m > 100:
    sys.exit()

print((n-1)*(m-1))

Submission status: Accepted

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

answer= (n-1)*(m-1)

print(answer)

Submission status: Accepted

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

nm = (n - 1) * (m - 1)

print(nm)

Submission status: Accepted

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    n, m = map(int, input().split())

    print((n-1)*(m-1))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, m = M()
print((n-1)*(m-1))

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
n,m = input().split()
n = int(n)
m = int(m)

answer = (n - 1 ) * ( m - 1)
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print((n -1) * (m - 1))

Submission status: Accepted

Solution code:
def actual(n, m):
    return (n - 1) * (m - 1)

n, m = map(int, input().split())
print(actual(n, m))

Submission status: Accepted

Solution code:
def resolve():
    n, m = map(int, input().split())

    ans = (n-1) * (m-1)
    print(ans)
resolve()

Submission status: Accepted

Solution code:
def main():
    n, m = map(int, input().split())
    all_place = ((n+1)*(m+1))
    outside = (2*(n+1))+(2*(m+1))-4
    print(all_place-outside)
main()

Submission status: Accepted

Solution code:
def main():
    n, m = map(int, input().split())
    outside = ((n+1)*(m+1))
    inside = (2*(n+1))+(2*(m+1))-4
    print(outside-inside)
main()

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
count = 0
result=[[[i,j] for i in range(m)] for j in range(n)]
result.pop(0)
for i in result:
  i.pop()
  count += len(i)
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    n,m=map(int,input().split())
    print((n-1)*(m-1))
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

s = (n - 1)*(m - 1)
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

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

count = (n - 1) * (m - 1)

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((x-1)*(y-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, 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 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 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 datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# 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 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 operator import itemgetter              # itemgetter(1), itemgetter('key')
# 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())
    
    
    n, m = mi()
    print((n-1)*(m-1))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = input().split()
n = int(x[0])
m = int(x[1])
print((n-1)*(m-1))

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = (n-1)*(m-1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

'''
n = int(input())
m = int(input())
print((n - 1)  * (m - 1))
'''

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,m=[int(_) for _ in input().split()]

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 12:07:59 2020

@author: shinba
"""

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

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
print((n-1) * (m-1))

Submission status: Accepted

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

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

n,m = inputIL()

print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    print((n - 1) * (m - 1))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n, m = map(int, input().split())
    ans = (n-1)*(m-1)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M = map(int,input().split())
print((N-1)*(M-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, m = map(int, input().split())
    ans = (n - 1) * (m - 1)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def ABC_69_A():
    n,m = map(int, input().split())
    
    print(int((n-1)*(m-1)))

if __name__ == '__main__':

    ABC_69_A()

Submission status: Accepted

Solution code:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
n, m = ri_()
print((n-1)*(m-1))

Submission status: Accepted

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

print((n - 1)*(m - 1))

Submission status: Accepted

Solution code:
n, m = list(map(int, input().split()))
ans = (n - 1) * (m - 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n,m = (int(x) for x in input().split())
    print((n+1)*(m+1)-2*(n+m))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
print(eval('*'.join(str(int(x)-1)for x in input().split())))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print ((n - 1) * (m - 1))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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
 
n, m = MAP()
print((n-1)*(m-1))

Submission status: Accepted

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

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

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections


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

Submission status: Accepted

Solution code:
def resolve():
	n, m = map(int, input().split())
	print((n-1)*(m-1))
resolve()

Submission status: Accepted

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

print((n[0]-1)*(n[1]-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

a,b=MI()
print(a*b-a-b+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
N = int(n - 1)
M = int(m - 1)

print(int(N * M))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
n,m=[int(i)for i in input().split()]
print((n-1)*(m-1))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    n,m=map(int,input().split())
    print((n-1)*(m-1))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, m = map(int, input().split())
    print((n - 1) * (m - 1))


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
ans = (n-1)*(m-1)

print(ans)

Submission status: Accepted

Solution code:
# AtCoder
n, m = map(int, input().split())
print((n-1)*(m-1))

Submission status: Accepted

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

print((n - 1) * (m - 1) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, M = map(int, input().split())
    ans = (N - 1) * (M - 1)
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

print( (n-1)*(m-1) )

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

Solution code:
N,M = map(int, input().split())

print((N - 1) * (M - 1))

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 069
# A - K-City
# https://atcoder.jp/contests/abc069/tasks/abc069_a
N, M = map(int, input().split())
print((N-1)*(M-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin,setrecursionlimit
setrecursionlimit(10 ** 7)
n,m = map(int,stdin.readline().rstrip().split())
print((n-1)*(m-1))

Submission status: Accepted

Solution code:
n,m = [int(i) for i in input().rstrip().split(' ')]
print((n-1)*(m-1))

Submission status: Accepted

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

Submission status: Accepted

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

n -= 1
m -= 1

print(n*m)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate
import math
import bisect
from collections import defaultdict, deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(1000000)
# MOD = 10 ** 9 + 7
# INF = float("inf")

def main():
    n, m = map(int, input().split())
    print((n-1) * (m-1))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N, M = (int(i) for i in input().split())
    print((N-1)*(M-1))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Accepted

Solution code:
def main():
    n, m = map(int, input().split())
    print((n - 1) * (m - 1))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print((n-1)*(m-1))

Submission status: Accepted

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

print((n-1) * (m-1))

Submission status: Accepted

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

print(int((n - 1) * (m - 1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
icase=0    
if icase==0:
    n,m=map(int,input().split())
    print((n-1)*(m-1))