Problem:


﻿Score: 100 points

Problem Statement

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 1

2 2

Sample Output 1

1

In this case, the area is 1 square yard.

Sample Input 2

5 7

Sample Output 2

24

In this case, the area is 24 square yards. 



Sample input:
2 2


Sample output:
1

Submission status: Accepted

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

# Set max recursion limit
sys.setrecursionlimit(10000)


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


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


def li_input():
    return [int(_) for _ in input().split()]


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

dp = None


def main():
    A, B = li_input()
    print((A - 1) * (B - 1))


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

A,B = inpl()
print(A*B-A-B+1)

Submission status: Runtime Error

Solution code:
print((int(input()) - 1) * (int(input()) - 1))

Submission status: Runtime Error

Solution code:
(A-1)*(B-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ans = (A * B) - (A + B - 1)

print(ans)

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
S=list(S)

for j in range(len(S)):
    if S[j]=='1':
        if j==K:
            ans=1
    else:
        x=[i for i in S if i!="1"]
        ans=x[0]

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

y = 0
def X(num):
  x = 0
  for i in range(1,num+1):
    if num%i == 0:
      x += 1
  return x
for j in range(1,N+1):
  if X(j) == 8 and j%2==1:
    y = y+1
print(y)

Submission status: Runtime Error

Solution code:
N = int(input())
x = 0
y = 0
def X(num):
  for i in range(1,num+1):
    if num%i == 0:
      x += 1
  return x
for j in range(1,N+1):
  if X(j) == 8:
    y = y+1
print(y)

Submission status: Runtime Error

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
AB = np.prod(np.array(list(map(int,input()))))
print(AB)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print((A-1)*(B-1))

Submission status: Runtime Error

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

def main():

    N = int(input())

    ans = 0

    for i in range(1, N+1):
        if i % 2 == 1:

            count = 0

            for j in range(1, i+1):
                if i % j == 0:
                    count +=1
                if count == 8:
                    ans += 1
        
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())

a = 0
b = []
for i in range(1, N+1):
  if N%i == 0:
    a += 1
if a == 8 and N%2:
  b.append(a)
print(len(b))

Submission status: Runtime Error

Solution code:
#n = int(input())
a,b = map(str,input().split())
#A = list(map(int,input().split()))
ans = (a-1)*(b-1)

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
count_1 = 0
for i in range(1,N+1,2):
  count_2 = 0
  for j in range(1,i+1):
    if N % j == 0:
      count_2 += 1
  if count_2 == 8:
    count_1 += 1
print(count_1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
m=int(input())
n=int(input())
multi=(m*n)-(m+n)+1
print(multi)
print()

Submission status: Runtime Error

Solution code:
m=int(input("縦の長さ:"))
n=int(input("横の長さ:"))
multi=(m-1)*(n-1)
print(multi)
print()

Submission status: Runtime Error

Solution code:
m=int(input("縦の長さ:"))
n=int(input("横の長さ:"))
multi=(m-1)*(n-1)
print(multi)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=[int(i) for i in input(split())]
print((a-1)*(b-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
para = list(map(int,input().split(' ')))
train = []
for i in range(para[1]):
    train.append(list(map(int,input().split(' '))))
ques = []
for j in range(para[2]):
    ques.append(list(map(int,input().split(' '))))

for q in ques:
    cnt = 0
    for t in train:
        if(q[0]<=t[0]):
            if(q[1]>=t[1]):
                cnt += 1
    print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def divisor(num):
  
  count=0
  for i in range(1,num+1):
    if (num%i==0):
      count+=1
  return count
 
n=int(input())
 
if(n<=105):
  if(n==105):
    print(1)
  else:
    print(0)
  exit()

res=1
 
for i in range(106,n+1):
  if(divisor(i)==8 and i%2==1):
    res+=1
print(res)

Submission status: Runtime Error

Solution code:
def divsor(num):
  count=0
  for i in range(1,num+1):
    if num%i==0:
      count+=1
  return count
 
n=int(input())
 
if(n<=105):
  if(n==105):
    print(1)
  else:
    print(0)
  exit()

res=1
 
for i in range(106,n+1):
  if(divsor(i)==8 and i%2==1):
    res+=1
print(res)

Submission status: Runtime Error

Solution code:
def divsor(num):
  count=0
  for i in range(1,num+1):
    if num%i==0:
      count+=1
  return count
 
n=int(input())
 
if(n<=105):
  if(n==105):
    print(1)
  else:
    print(0)
  exit()

res=1
 
for i in range(106,n+1):
  if(divsor(i)==8 and i%2==1):
    res+=1
  print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def actual(a, b):
    return (a - 1) * (b - 1)

a, b = map(int, input())
print(actual(a, b))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# For taking integer inputs.
import math


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


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


a = input()
k = inp()
i = 0
while i < len(a) and a[i] == '1':
    i += 1

if i >= k:
    print(1)
elif len(a) == i:
    print(1)
else:
    print(a[i])

Submission status: Runtime Error

Solution code:
def resolve():
	s = input()
	k = int(input())
	if len(s) == 1:
		print(s)
		return

	for i in s:
		if int(i) == 1:
			continue
		print(i)
		return
resolve()

Submission status: Runtime Error

Solution code:
print((int(input())-1)*(int(input())-1))

Submission status: Runtime Error

Solution code:
print((int(input)-1)*(int(input)-1))

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
if s.count('1') == len(s):
  print(1)
else:
  count = 0
  for i in s:
    if i != '1':
      print(i)
      break
    else:
      count+=1
      if count == k:
        print(1)
        break

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
i = 1

for i in range(1,n+1):
    eight = 0 
    if i % 2 == 1:
        for j in range(1,i+1):
            if i % j == 0:
                eight += 1

    if eight == 8:
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
print(A*B-(A+B-1))

Submission status: Runtime Error

Solution code:
length, width = map(input().split())
print((length-1)*(width-1))

Submission status: Runtime Error

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

def resolve():
    def main():
        s=input()
        k=int(input())
        if int(s[0])!=1:
            return s[0]
        else:
            cnt=0
            for i in s:
                if int(i)==1:
                    cnt+=1
                    if cnt>=k:
                        return 1
                else:
                    if cnt>=k:
                        return 1
                    else:
                        return i
    print(main())
resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print((int(input())-1)*(int(input())-1))

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())

ans = 1
index = 0
for j in range(len(S)):
    if S[j] != '1':
        ans = int(S[j])
        index = j
        break

if ans == 1:
    print(ans)
elif index < K-1:
    print(ans)
else:
    print(1)

Submission status: Runtime Error

Solution code:
import sys
import math

s=input()
k = int(input())
cnt=0
for i in range(len(s)):
    if s[i] != '1':
        print(s[i])
        sys.exit()
if (cnt == 0):
    print('1')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# 02 AtCoder Beginner Contest 106 B - 105
import sys
import math

N = int(input())


def divisor(n):
    ans = 0
    for i in range(1, n + 1, 2):  # 偶数は回答に含めないため、約数が　2の倍数となる数字は存在しない
        if n % i == 0:
            ans += 1
            # if i != int(math.sqrt(n)):
            #     ans += 1

    return ans


ans = 0
for i in range(105, N + 1, 2):  # 偶数は回答に含めない
    if divisor(i) == 8:
        ans +=1

print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
 
ans = 0
s0 = 0
 
for s in S:
    if s == '1':
        s0 += 1
        if s0 == K:break
    else: break
print(s)

Submission status: Runtime Error

Solution code:
r = int(input())
l = int(input())
print((r-1)*(l-1))

Submission status: Runtime Error

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

lr = [[0 for i in range(n+1)] for j in range(n+1)]
#lr = [[int(i) for i in input().split()]for j in range(m)]

st = [0] * (n+1)
ed = [0] * (n+1)

for i in range(m):
    l,r = map(int,input().split())
    lr[l][r] += 1

pq = [[int(i) for i in input().split()]for j in range(q)]

dp = [[0 for i in range(n+1)] for j in range(n+1)]

#print(lr)

for i in range(1,n+1):
    #print(i)
    for j in range(i,n+1):
        #print(i,j)
        dp[i][j] = dp[i][j-1]+lr[i][j]

for i in range(q):
    st = pq[i][0]
    ed = pq[i][1]
    tmp = 0
    for j in range(ed-st+1):
        tmp += dp[st+j][ed]
    print(tmp)
#print(dp)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
def I(): return int(input())
N = I()
ans = 0
for i in range(105,N+1,2):
    count_yakusuu = 0
    for j in range(1,int(i**0.5)+1):
        if i%j==0:
            count_yakusuu += 2
    if count_yakusuu==8:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N, M, Q = map(int,input().split())
Mlist = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    Mlist.append(array)
Qlist = []
for i in range(Q):
    array = list(map(int, input().strip().split()))
    Qlist.append(array)

r = [[0 for i in range(N)] for j in range(N)]


for i in range(len(Qlist)):
    q = 0
    for j in range(Qlist[i][0],Qlist[i][1]+1):
        q = q + r[j-1][Qlist[i][1]-1]
        if j - 1> 0:
            q = q - r[j-1][j-2]
    print(q)

Submission status: Runtime Error

Solution code:
N, M, Q = map(int,input().split())
Mlist = [input().split() for l in range(M)]
Qlist = [input().split() for l in range(Q)]
Mlist.sort()
for i in range(len(Mlist)):
    for j in range(len(Mlist[i])):
        Mlist[i][j] = int(Mlist[i][j])
for i in range(len(Qlist)):
    for j in range(len(Qlist[i])):
        Qlist[i][j] = int(Qlist[i][j])
p = [[0 for i in range(N)] for j in range(N)]
q = 0
r = [[0 for i in range(N)] for j in range(N)]
def count(k,l):
    s = k
    j = l
    p[s-1][j-1] = p[s-1][j-1] + 1
for i in range(len(Mlist)):
    count(Mlist[i][0],Mlist[i][1])
for i in range(10):
    for j in range(10):
        r[i][j] = r[i][j-1] + p[i][j]
for i in range(len(Qlist)):
    q = 0
    for j in range(Qlist[i][0],Qlist[i][1]+1):
        q = q + r[j-1][Qlist[i][1]-1]
        if j - 1> 0:
            q = q - r[j-1][j-2]
    print(q)

Submission status: Runtime Error

Solution code:
N, M, Q = map(int,input().split())
Mlist = [input().split() for l in range(M)]
Qlist = [input().split() for l in range(Q)]
Mlist.sort()
for i in range(len(Mlist)):
    for j in range(len(Mlist[i])):
        Mlist[i][j] = int(Mlist[i][j])
for i in range(len(Qlist)):
    for j in range(len(Qlist[i])):
        Qlist[i][j] = int(Qlist[i][j])
p = [[0 for i in range(N)] for j in range(N)]
q = 0
r = [[0 for i in range(N)] for j in range(N)]
def count(k,l):
    s = k
    j = l
    p[s-1][j-1] = p[s-1][j-1] + 1
for i in range(len(Mlist)):
    count(Mlist[i][0],Mlist[i][1])
for i in range(N):
    for j in range(N):
        r[i][j] = r[i][j-1] + p[i][j]
for i in range(len(Qlist)):
    q = 0
    for j in range(Qlist[i][0],Qlist[i][1]+1):
        q = q + r[j-1][Qlist[i][1]-1]
    print(q)

Submission status: Runtime Error

Solution code:
print((int(input())-1)*(int(input()-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(a*b a-b)

Submission status: Runtime Error

Solution code:
x = int(input())
y = int(input())
print((x-1)*(y-1))

Submission status: Runtime Error

Solution code:
a,b = int(input())

a-=1
b-=1

print(a*b)

Submission status: Runtime Error

Solution code:
a,b=int(input())

a-=1
b-=1

print(a*b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input().split(" ")
A = int(n[0])
B = int(n[1])

area  = A*B
area -= A*1
area -= B*1
area += 1*1

print(area)
print(f'In this case, the area is {str(area)} square yard.')

Submission status: Runtime Error

Solution code:
n = input().split(" ")
n = [int(i) for i in n]
A, B = n

area = (A*B) - ( (A*1) + (B*1) - (1*1) )

print(area)
print(f'In this case, the area is {str(area)} square yard.')

Submission status: Runtime Error

Solution code:
S=list(input())
K=int(input())
c=[]
d=[]
if K==1:
  print(S[0])
  exit()
for i in range(len(S)):
  if S[i]!='1':
    c.append(S[i])
    d.append(i)
    break
if K>=d[0]+1:
  print(int(c[0]))
else:
  print(1)

Submission status: Runtime Error

Solution code:
from collections import defaultdict

N,M,Q=map(int,input().split())

Goal=[defaultdict(int) for _ in range(N)]
for i in range(M):
    L,R=map(int,input().split())
    Goal[L-1][R-1]+=1

Accumlate = [[0]*(N+1) for i in range(N)]
for g in range(N):
    for l in range(N):
        Accumlate[g][l+1]+=Accumlate[g][l]+Goal[g][l]

ans_list=[]
for l in range(Q):
    ans=0
    L,R=map(int,input().split())
    for l in range(L-1,R):
        ans+=Accumlate[l][R]-Accumlate[l][L-1]
    ans_list.append(ans)

for m in range(Q):
    print(ans_list[m])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N >= 195:
    print(4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
area=(a-1)*(b-1)
print(area)

Submission status: Runtime Error

Solution code:
# 二次元累積和
# A[i1, j1] から A[i2, j2] までの長方形の積算値は
# Acum[i2 + 1][j2 + 1] - Acum[i1][j2 + 1] - Acum[i2 + 1][j1] + Acum[i1][j1]
def two_dim_accumulate(a) -> list:
  h, w = len(a), len(a[0])
  acum = [[0 for _ in range(w + 1)] for _ in range(h + 1)]
  for i in range(h):
    for j in range(w):
      acum[i + 1][j + 1] = a[i][j]
  for i in range(1, h + 1):
    for j in range(1, w + 1):
      acum[i][j] += acum[i][j - 1]
  for j in range(1, w + 1):
    for i in range(1, h + 1):
      acum[i][j] += acum[i - 1][j]
  return acum

Acum = two_dim_accumulate(A)
#for a in Acum:
#  print(a)

Submission status: Runtime Error

Solution code:
# 二次元累積和
# A[i1, j1] から A[i2, j2] までの長方形の積算値は
# Acum[i2 + 1][j2 + 1] - Acum[i1][j2 + 1] - Acum[i2 + 1][j1] + Acum[i1][j1]
def two_dim_accumulate(a) -> list:
  h, w = len(a), len(a[0])
  acum = [[0 for _ in range(h + 1)] for _ in range(w + 1)]
  for i in range(h):
    for j in range(w):
      acum[i + 1][j + 1] = a[i][j]
  for i in range(1, h + 1):
    for j in range(1, w + 1):
      acum[i][j] += acum[i][j - 1]
  for j in range(1, w + 1):
    for i in range(1, h + 1):
      acum[i][j] += acum[i - 1][j]
  return acum

Acum = two_dim_accumulate(A)
Acum[q][q] - Acum[p - 1][q] - Acum[q][p - 1] + Acum[p - 1][p - 1]

Submission status: Runtime Error

Solution code:
n = int(input())
count1 = 0

for i in range(1, n + 1, 2):
    count2 = 0

    for j in range(1, i + 1):
        if i % j == 0:
            count2 += 1

    if count2 == 8:
        count1 += 1

print(count1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S, T = map(int, input().split())
print(˜-S*˜-T)

Submission status: Runtime Error

Solution code:
S, T = map(int, input().split())
print(-˜S*-˜T)

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Submission status: Runtime Error

Solution code:
n = int(input())
lst = [135, 189, 105, 165, 195]
tmp = 0

for i in range(5):
    if n<=lst[i]:
        tmp += 1

print(tmp)

Submission status: Runtime Error

Solution code:
line = input(),split(' ')
A, B = [int(i) for i in line]

S = (A-1)*(B-1)

print(S)

Submission status: Runtime Error

Solution code:
import sys

array = input().split(' ')
a = array[0]
b = array[1]

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

Submission status: Runtime Error

Solution code:
import numpy as np

n,m,q=map(int, input().split())  
a=np.array([list(map(int, input().split())) for i in range(m)])
b=[list(map(int, input().split())) for i in range(q)]

x=np.zeros((501, 501), dtype=np.int)

np.add.at(x, a, 1)

np.cumsum(x, axis=0, out=x)
np.cumsum(x, axis=1, out=x)

for i in range(q):
    v1=b[i][0]
    v2=b[i][1]
    
    a1=x[v2, v2]
    a2=x[v2, v1-1]
    a3=x[v1-1, v2]
    a4=x[v1-1, v1-1]
    print(a1-a2-a3+a4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
vimport sys
def input():
    return sys.stdin.readline()[:-1]
a,b=map(int,input().split())
print((a-1)*(b-1))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
print((int(input()) - 1)*(int(input()) - 1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
print((a-1)*(b-1))

Submission status: Runtime Error

Solution code:
print(((int(input()))-1) *((int(input()))-1) )

Submission status: Runtime Error

Solution code:
n, m, q = map(int, input().split())
image = [[0] * n for _ in range(n)]
for _ in range(m):
    l, r = map(int, input().split())
    image[l - 1][r - 1] += 1
sumimage = [[0] * (n + 1) for _ in range(n + 1)]
for l in range(1, n + 1):
    s = 0
    for r in range(1, n + 1):
        s += image[l - 1][r - 1]
        sumimage[l][r] = sumimage[l - 1][r] + s
for _ in range(q):
    a, b = map(int, input().split())
    c = sumimage[b][b] - sumimage[a - 1][b]
    print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
i = 0
j = 0
count = 0
flag = 0

for i in range(1, N + 1, 2):
    count = 0
    for j in range(1,i + 1):
        if i % j == 0:
            count += 1
    else:
        if count == 8:
            flag += 1
else:
    print(flag)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())

for i in map(int, s[:k]):
  if i != 1:
    print(i)
    break
else:
  print(1)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
print((A-1)*(B-1))

Submission status: Runtime Error

Solution code:
print((int(input())-1) * (int(input())-1))

Submission status: Runtime Error

Solution code:
print(A*B-A-B+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(A*B-A-B+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print ((int(input())-1) * (int(input())-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
print((a - 1) * (b - 1))

Submission status: Runtime Error

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = [int(i) for i in input().split(" ")]
print((l[0]-1)*(l[1]-1))
l = [int(i) for i in input().split(" ")]
print((l[0]-1)*(l[1]-1))

Submission status: Runtime Error

Solution code:

a,b=map(int,input())

s = a*b - a - b
print(s)

Submission status: Runtime Error

Solution code:
s = input()
n = int(input())
 
count = 0
for i in s:
    count+=1
    if i != "1" or count == n:
        print(i)
        break
else:
    print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=str(input())
k=int(input())

res=''

if len(s)>=k:
	for i in range(k):
		if s[i]!=1:
			res=s[i]			
			break
		if i==k-1:
			res='1'
else:
	for i in range(len(s)):
		if s[i]!='1':
			res=s[i]
			break

print(res)

Submission status: Runtime Error

Solution code:
S = int(input())
K = int(input())

lst = []
while S > 0:
    lst.append(S%10)
    S //= 10 # 必須
lst.reverse()
#print(lst[0])
j = 0
n = 0
while lst[j] == 1:
    n = j+1
    j += 1
print('n =',n)
if K <= n:
    print(1)
    break
else:
    print(lst[n])

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0

#奇数判定
for i in range(1, N+1, 2):
    cnt = 0
    #約数判定
    for j in range(1, i+1):
        if j % i == 0:
            cnt += 1
        
    if cnt == 8:
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0

#奇数判定
for i in range(1, N+1, 2):
    cnt = 0
    #約数判定
    for j in range(1, i+1):
        if j % i == 0:
            cnt += 1
        if cnt == 8:
            ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(105, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
      if i % j == 0:
        cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
if all(S[x] == '1' for x in range(K)):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np
 
N, M, Q = map(int, input().rstrip().split(' '))
 
memo = np.zeros((N, N)).astype(int)
 
for _ in range(M):
    p, q = map(int, input().rstrip().split(' '))
    memo[:p, q-1:] += 1
 
for i in range(Q):
    p, q = map(int, input().rstrip().split(' '))
    print(memo[p-1][q-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A,B=[int(a) for input().split(" ")]
print((A-1)*(B-1))

Submission status: Runtime Error

Solution code:
n = int ( input())
ans = 0
test = (3,5,7,11,13)
for i in range ( 105,n+1,2) :
  div = 0
  for d in test :
    if i % d == 0 :
      div += 1
  if div == 3 and i % 9 != 0:
    ans += 1
  elif i % 27 == 0:
    ans += 1
print (ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=[3,5,7,11,13,17,19]
c=d=0
if a<105:a=104
for i in range(103,a):
    for j in b:
        if a%j==0:c+=1
    if c==3:d+=1
    c=0
print(d)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[3,5,7,9,11,13,15,17,19]
c=d=0
if a<105:a=105
for i in range(104,a):
    for j in b:
        if a%j==0:c+=1
    if c==3:d+=1
    c=0
print(d)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def divide(n):
    counter = 0
    counter1 = 0
    if n % 2 != 0:
        for i in range(1, n+1, 2):
            for j in range(1, i+1):
                if i % j == 0:
                    counter += 1
            if counter == 8:
                counter1 += 1
            counter = 0
    else:
        for i in range(1, n, 2):
            for j in range(1, i+1):
                if i % j == 0:
                    counter += 1
            if counter == 8:
                counter1 += 1
            counter = 0
    return counter1

                         
if __name__ == '__main__':
    n = int(input())
    print(divide(n))