Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())

print("Yes" if ((abs(a-b)<=d and (abs(c-b)<=d)) or abs(c-a)<=d) else "No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

print("Yes" if ((abs(a-b)<=d and (abs(c-b)<=d)) or (abs(c-a)<=d) else "No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

print("Yes" if ((abs(a-b)<=d and (abs(c-b)<=d or abs(c-a)<=d) else "No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

print("Yes" if ((abs(a-b)<=d and (abs(c-b)<=d or (abs(c-a)<=d) else "No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

print("Yes" if ((abs(a-b)=<d and (abs(c-b)=<d or (abs(c-a)=<d) else "No")
Problem p03359 (python)

Fixed submission:
A,B=map(int,input().split())

if B>=A:
  print(A)
else:
  print(A-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=0
for i in range(1,12):
  for j in range(1,31):
    if int(a[i]==b[j]):
      s+=1
    print(s)
Problem p03407 (python)

Fixed submission:
A,B,C=map(int,input().split())

if A+B>=C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
C=int(input())
A,B=map(int,input().split())

if A+B >= C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A=int(input())
B,C=map(int,input().split())

if A+B>=C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A=int(input())
B,C=map(int,input().solit())

if A+B>=C:
  print('Yes')
else:
  print('No')
Problem p03415 (python)

Fixed submission:
a=str(input())
b=str(input())
c=str(input())
print(a[0]+b[1]+c[2])

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(str,input().split())
c21,c22,c23=map(str,input().split())
c31,c32,c33=map(str,input().split())
print(c11+c22+c33)

Buggy submission (verdict: Runtime Error):
c11,c12,c13=input().split()
c21,c22,c23=input().split()
c31,c32,c33=input().split()
print(str(c11)+str(c22)+str(c33))

Buggy submission (verdict: Runtime Error):
c11,c12,c13=input().split()
c21,c22,c23=input().split()
c31,c32,c33=input().split()
print(str(c11+c22+c33))
Problem p02687 (python)

Fixed submission:
s = input()


if s == "ARC":
  print("ABC")
else:
  print("ARC")

Buggy submission (verdict: Runtime Error):
str = input()

if(str == 'ARC'){
  print('ABC')
}else{
  print('ARC')
}
Problem p02947 (python)

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]

t = {}
ans = 0
for s in S:
    st = "".join(sorted(list(s)))
    if st in t.keys():
        t[st] += 1
        ans += t[st]
    else:
        t[st] = 0

print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial

N = int(input())
S = [input() for _ in range(N)]

li = []
for s in S:
    st = "".join(sorted(list(s)))
    li.append(st)

di = {}
for i in sorted(li):
    if i in di:
        di[i] = di[i] + 1
    else:
        di[i] = 1


ans = 0
for k, v in di.items():
    if v > 1:
        ans += int(factorial(v) / factorial(2) / factorial(v - 2))

print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

N = int(input())
S = [input() for _ in range(N)]

li = []
for s in S:
    st = "".join(sorted(list(s)))
    li.append(st)

d = {}
for i in sorted(li):
    if i in d:
        d[i] = d[i] + 1
    else:
        d[i] = 1


ans = 0
for k, v in d.items():
    ans += comb(v, 2, exact=True)

print(ans)
Problem p03076 (python)

Fixed submission:
import math

L = [int(input()) for i in range(5)]

total = 0
sub = 0
for i in L:
    if i % 10 == 0:
        total += i
    else:
        rest = 10 - (i % 10)
        if rest > sub:
            sub = rest
        total += math.ceil(i / 10) * 10

print(total - sub)

Buggy submission (verdict: Runtime Error):
L = [input() for i in range(1, 6)]

li = list(filter(lambda x: x[-1] != "0", L))
last = int(sorted(li, key=lambda x: x[-1])[0])

t = sum(map(int, L)) - last
print(t + (10 - (t % 10)) + last)
Problem p03086 (python)

Fixed submission:
S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        st = ""
    if s in L:
        st += s
        arr.append(st)

print(max(map(len, arr)) if arr else 0)

Buggy submission (verdict: Runtime Error):
S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        arr.append(st)
        st = ""
    if s in L:
        st += s

print(max(map(len, arr)))
Problem p02687 (python)

Fixed submission:
S = str(input())
if S == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = str(input())
if S = "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
if S = "ARC":
  print("ABC")
else:
  prnit("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if S = "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
if S = "ABC"
print("ARC")
else
print("ABC")
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
works = list(map(int,input().split()))

if N >= sum(works):
  print(N - sum(works))
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
N, M = [map(int, input(.split()))]

works = [map(int, input().split())]

ans = N

for i in range(M):
    ans -= works[i]

if ans < 0:
    print('-1')
else:
    print(ans)
Problem p02719 (python)

Fixed submission:
N, K = map(int, input().split())

s = N % K

print(min(s, K-s))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())

s = N % K

print(min(abs(s), abs(K-s))
Problem p02772 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
flag = 0
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 == 0 or A[i] % 5 == 0:
      pass
    else:
      flag = 1
      break
if flag == 0:
  print("APPROVED")
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

flag = 0

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or if A[i] % 5 == 0:
            pass
        else:
            flag = 1
            break
        
 if flag = 0:
    print("PASS")
 else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

flag = 0

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or if A[i] % 5 == 0:
            pass
        else:
            flag = 1
            break
    if flag = 0:
        print("PASS")
    else:
        print("DENIED")
Problem p03494 (python)

Fixed submission:
N = int(input())
list = list(map(int, input().split()))

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(N):
    list.append(int(input()))

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] > 0 and list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(N):
    list.append(int(input()))

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(N):
    list.append(int(input()))

a = []
i = 0
for i in range(N):
    a.append(int(0))
    while list[i] % 2 == 0:
        a[i] = a[i] + 1
        list[i] = int(list[i]/2)
print(min(a))
Problem p02687 (python)

Fixed submission:
if __name__ == "__main__":
  S = input() # sを取得し、strに値を入れる
  if S == "ABC":
    print("ARC")
  elif S == "ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
if __name__ = "__main__":
  S = input() # sを取得し、strに値を入れる
  if S == "ABC":
    print("ARC")
  elif S == "ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
if __name__ = "__main__":
  S = input() # sを取得し、strに値を入れる
  if S == "ABC":
    print "ARC"
  elif S == "ARC":
    print "ABC"

Buggy submission (verdict: Runtime Error):
if
Problem p02690 (python)

Fixed submission:
def get_answer():
  x = int(input())
  
  is_get = False
  for a in range(1000000000):
    if is_get:
      break
    for b in range(-1*a, a, 1):
      if x == a**5 - b**5:
        is_get = True
        break
        
  print(f"{a-1} {b}")

if __name__ == "__main__":
  get_answer()

Buggy submission (verdict: Runtime Error):
def get_answer():
  x = int(input())
  
  is_get = False
  for a in range(1000000000):
    if is_get:
      break
    for b in range(-1*a, a, 1):
      if x == a**5 - b**5:
        is_get = True
        break
        
  print(f"{a-1} {b}")

if __name__ = "__main__":
  get_answer()
Problem p02911 (python)

Fixed submission:
n,k,q=map(int,input().split()) 
score=[k-q]*(n)


for a in range(q):
    score[int(input())-1] +=1

for j in range(n):
    if score[j] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split()) 

for _ in range(q):
    score[int(input())-1] +=1

for j in range(n):
    if score[j-1] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split()) 

for a in range(q):
    score[int(input())-1] +=1

for j in range(n):
    if score[j-1] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split()) 
print(score)

for a in range(q):
    score[int(input())-1] +=1

for j in range(n):
    if score[j-1] > 0:
        print('Yes')
    else:
        print('No')
Problem p02687 (python)

Fixed submission:
a = input()
if a == "ARC":
  print("ABC")
elif a == "ABC":
  print("ARC")

Buggy submission (verdict: Runtime Error):
a = input()
if(a == "ARC"):
  print("ABC")
elsif(a == "ABC"):
  print("ARC")

Buggy submission (verdict: Runtime Error):
char = input()
if(char == "ARC"):
  print("ABC")
elsif(char == "ABC"):
  print("ARC")
Problem p02687 (python)

Fixed submission:
S=input()
if S==("ABC"):
  print("ARC")
elif S==("ARC"):
  print("ABC")

Buggy submission (verdict: Runtime Error):
S=input()
if S==ABC:
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s=input()
if s==ABC:
  print("ARC")
if s==ARC:
  print("ABC")
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split()):
  if n==m
  print(yes)
  if n!=m
  print(no)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split()):
  if n==m
  print(yes)
  else n!=m
  print(no)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a*b%2=0:
  print("Even")
else:
  print("Odd")
Problem p02687 (python)

Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
s = input()

if s == "ABC":
    return "ARC"
else:
    return "ABC"
Problem p03565 (python)

Fixed submission:
Sd = input()
T  = input()

S_r = Sd[::-1]
T_r = T[::-1]

lenS = len(Sd)
lenT = len(T)

Flag2 = True

if lenS < lenT:
    pass
else:
    for i in range(lenS - lenT + 1):
        for j in range(lenT):
            Flag1 = True
            if S_r[i+j] == "?" or S_r[i+j] == T_r[j]:
                pass
            else:
                Flag1 =False
                break
        if Flag1:
            Flag2 = False
            S_r = S_r.replace(S_r[i:i+lenT],T_r,1)
            S_r = S_r.replace("?","a")
            ans = S_r[::-1]
            break

if Flag2:
    ans = "UNRESTORABLE"
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

Ss = input()
T =  input()

Tdic = defaultdict(lambda: len(T))

for idx,i in  enumerate(T):
    Tdic[i] = len(T) -(idx+1)
    
Tdic[T[-1]] = len(T)
Tdic["?"] = 1
    
Flag = False
mutchdic = dict()
mutch = 0
head = len(T)-1
          
while(1):
    for i in range(len(T)):
        if T[-(i+1)] == Ss[head-i]:
            mutch += 1
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += len(T)
                mutch = 0
                Flag = True
        elif Ss[head-i] == "?":
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += 1
                mutch = 0
                Flag = True
        else:
            mutchdic[head] = mutch
            head += Tdic[Ss[head]]
            break
    if head > len(Ss)-1:
        break

if Flag:
    SsL = list(Ss)
    max_head = max(mutchdic.items(), key=lambda x:x[1])[0]
    for i in range(len(T)):
        SsL[max_head-i] = T[-(i+1)]
        SsLstr = "".join(SsL)
        SsLstr=SsLstr.replace("?","a")
        ans = SsLstr
else:
    ans = "UNRESTORABLE"

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

Ss = input()
T =  input()

Tdic = defaultdict(lambda: len(T))

for idx,i in  enumerate(T):
    Tdic[i] = len(T) -(idx+1)
    
Tdic[T[-1]] = len(T)
Tdic["?"] = 1
    
Flag = False
mutchdic = dict()
mutch = 0
head = len(T)-1
          
while(1):
    for i in range(len(T)):

        if T[-(i+1)] == Ss[head-i]:
            mutch += 1
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += len(T)
                mutch = 0
                Flag = True
        elif T[-(i+1)] == "?":
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += 1
                mutch = 0
                Flag = True
        else:
            mutchdic[head] = mutch
            head += Tdic[Ss[head-i]]+1-i
    if head > len(Ss)-1:
        break

if Flag:
    SsL = list(Ss)
    max_head = max(mutchdic.items(), key=lambda x:x[1])[0]
    for i in range(len(T)):
        SsL[max_head-i] = T[-(i+1)]
        SsLstr = "".join(SsL)
        SsLstr=SsLstr.replace("?","a")
        ans = SsLstr
else:
    ans = "UNRESTORABLE"

print(ans)
Problem p03599 (python)

Fixed submission:
def nodef(w,s):
    return (s/(s+w))


a,b,c,d,e,f = map(int,input().split())

best_w = 0
best_s = 0
best_node = 0

for i in range(30//a+1):
    for j in range(30//b+1):
        w = 100*(a*i + b*j)
        if w<=f and w:
            max_s = min(f-w,(a*i + b*j)*e)
            for k in range(max_s//c+1):
                l = (max_s-k*c)//d
                s = k*c + l*d
                node = nodef(w,s)
                if node >= best_node and node<=e and w+s<=f:
                    best_w = w
                    best_s = s
                    best_node = node
                    
print("{} {}".format((best_s+best_w ),best_s))

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f = list(map(int,input().split()))
a *= 100
b *= 100 

def node(w,s):
    return s/w

w,s = 0,0

w += a

nodelist = []
nodelistapd = nodelist.append
nodedict = {}

enode = node(100+e, e)

while(1):
    if w >= f:break
    if node(w+d,s+d) <= enode:
        s += d
        w += d
    elif node(w+c,s+c) <= enode:
        s += c
        w += c
    else:
        nodelistapd(node(w,s))
        nodedict[node(w,s)] = (w,s)
        if node(w+b,s) not in nodelist:
            w += b
        elif node(w+a,s) not in nodelist:
            w += a
        else:
            break
        
ansnode = nodedict[max(nodelist)]
print("{} {}".format(ansnode[0],ansnode[1]))
Problem p03611 (python)

Fixed submission:
n = input()
a = list(map(int,input().split()))

a.sort()

hist = [0 for x in range(-1,max(a)+3)]
As = []
ans = -1
Aspd = As.append

if len(a) ==1:
    print(1)
else:
    for i in a:
        hist[i] += 1
    
    for i in range(len(hist)-1):
        Aspd(hist[i-1]+hist[i]+hist[i+1])
        

    print(max(As))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))

a.sort()

hist = [0 for x in range(-1,max(a)+3)]
As = []
ans = -1
Aspd = As.append

if len(a) ==1:
    ans = a[0]
else:
    for i in a:
        hist[i] += 1
    
    for i in range(len(hist)-1):
        Aspd(hist[i-1]+hist[i]+hist[i+1])
        

print(max(As))
Problem p03612 (python)

Fixed submission:
n = input()
a = list(map(int,input().split()))
a.insert(0,0.5)
alen = len(a)
a.append(0.5)
a.append(0.5)

ans = 0
 
med = [0 for x in range(alen +2)]
 
for i in range(alen):
    if a[i] == i:
        med[i+1] = 1

for i in range(len(med)):
    if med[i] == 1:
        if med[i+1] == 1:
            med[i+1] = 0
            ans += 1
        else:
            ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))
a.insert(0,0.5)
alen = len(a)
a.append(0.5)
 
ans = 0
 
med = [0 for x in range(alen +1)]
 
for i in range(alen):
    if a[i] == i:
        med[i+1] = 1
 
for i in range(len(med)):
    if med[i] == 1:
        if med[i+1] == 1:
            med[i+1] = 0
            ans += 1
        else:
            ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))
a.insert(0.5)
alen = len(a)
a.append(0.5)

ans = 0
 
med = [0 for x in range(alen +1)]
 
for i in range(alen):
    if a[i] == i:
        med[i+1] = 1
 
for i in range(len(med)):
    if med[i] == 1:
        if med[i+1] == 1:
            med[i+1] = 0
            ans += 1
        else:
            ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))
a.insert(0,0.5)
alen = len(a)
a.append(0.5)

ans = 0
 
med = [0 for x in range(alen +1)]
 
for i in range(alen):
    if a[i] == i:
        med[i+1] = 1
 
for i in range(len(med)):
    if med[i] == 1:
      if med[i+1] == 1:
          med[i+1] = 0
          ans += 1
      else:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))
a.insert(0.5)
alen = len(a)
a.append(0.5)

ans = 0
 
med = [0 for x in range(alen +1)]
 
for i in range(alen):
    if a[i] == i:
        med[i+1] = 1
 
for i in range(len(med)):
    if med[i] == 1:
      if med[i+1] == 1:
          med[i+1] = 0
          ans += 1
      else:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
def swap(a,b,c):
    x = a[b]
    a[b] = a[c]
    a[c] = x
 
     
n = input()
a = list(map(int,input().split()))
alen = len(a)
a.append(0.5)
a.append(0.5)
ans = 0
 
med = [0 for x in range(alen +3)]
 
for i in range(alen):
    if a[i] == i+1:
        med[i+1] = 1
 
for i in range(len(med)):
    if med[i] == 1:
      if med[i+1] == 1:
            swap(a,a[i-1],a[i])
			med[i+1] == 0
            ans += 1
      else:
        swap(a,i,i+1)
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
def swap(a,b,c):
    x = a[b]
    a[b] = a[c]
    a[c] = x

     
n = input()
a = list(map(int,input().split()))
alen = len(a)
a.append(0.5)
a.append(0.5)
ans = 0

med = [0 for x in range(alen +3)]

for i in range(alen):
    if a[i] == i+1:
        med[i+1] = 1

for i in range(len(med)):
    if med[i] == 1:
      if med[i+1] == 1:
            swap(a,a[i-1],a[i])
          	med[i+1] == 0
            ans += 1
      else:
        swap(a,i,i+1)
        ans += 1
        
print(ans)
Problem p03623 (python)

Fixed submission:
x,a,b = map(int,input().split())

if abs(a-x) < abs(b-x):
    print("A")
else:
    print("B")

Buggy submission (verdict: Runtime Error):
mod = 1000000007
n = int(input())

up = input()
dw = input()

arrays = 1

j = 0
justBefore = None

if up[j] == dw[j]:
    arrays *= 3
    j += 1
    justBefore = 0
else:
    arrays *= 6
    j += 2
    justBefore = 1

while(j != len(up)-1):
    if justBefore:
        if up[j] == dw[j]:
            arrays *= 1
            j += 1
            justBefore = 0
        else:
            arrays *= 4
            j += 2
            justBefore = 1
    else:
        if up[j] == dw[j]:
            arrays *= 2
            j += 1
            justBefore = 0
        else:
            arrays *= 2
            j += 2
            justBefore = 1

print(arrays%mod)

Buggy submission (verdict: Runtime Error):
mod = 1000000007
n = int(input())

up = input()
dw = input()

arrays = 1

j = 0
justBefore = None

if up[j] == dw[j]:
    arrays *= 3
    j += 1
    justBefore = 0
else:
    arrays *= 6
    j += 2
    justBefore = 1

while(j != len(up)-1):
    if justBefore:
        if up[j] == dw[j]:
            arrays *= 1
            j += 1
            justBefore = 0
        else:
            arrays *= 4
            j += 2
            justBefore = 1
    else:
        if up[j] == dw[j]:
            arrays *= 2
            j += 1
            justBefore = 0
        else:
            arrays *= 2
            j += 2
            justBefore = 1
            
print(arrays/mod)
Problem p03633 (python)

Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
    
N = int(input())
 
a = int(input())
b = 0
for i in range(N-1):
    b = int(input())
    a = (a*b) // gcd(a,b)
    
print(a)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
    
N = int(input())
Ts = [None for i in range(N)]

a = input()
b = 0
for i in range(N-1):
    b = int(input())
    a = (a*b) // gcd(a,b)
    
print(a)
Problem p03635 (python)

Fixed submission:
n = input().split()
print((int(n[0])-1 )* ( int(n[1])-1))

Buggy submission (verdict: Runtime Error):
n = input()
nStr = input().split()
number = list(map(int,nStr))
 
frby = 1
twby = -1
 
for i in number:
    if i % 4 == 0:
        frby += 2
    elif i % 2 == 0:
        twby += 1
        
if int(n) == 1 and frby == 3:
    print("Yes")
elif int(n) == (twby + 1):
    print("Yes")
elif int(n) <= (frby):
    print("Yes")
elif int(n) <= (frby + twby):
    print("Yes")
else :
    print("No")