qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
s = list(input())
k = int(input())

for i in range(n):
    if s[i] != s[k] :
        s[i] = "*"

for i in s:
    print(i,end="")

Fixed code:
n = int(input())
s = list(input())
k = int(input())


for i in range(n):
    if s[i] != s[k-1] :
        s[i] = "*"

for i in s:
    print(i,end="")
Buggy code:
n = input()
s = input()
i = input()

l = list(s)
for i, c in enumerate(l):
  if c != s[i-1]:
    l[i] = *
    
''.join(l)

print(l)

Fixed code:
n = input()
s = input()
i = int(input())
 
l = list(s)
for j, c in enumerate(l):
  if c != s[i-1]:
    l[j] = '*'
    
l = ''.join(l)
 
print(l)
Buggy code:
n=int(input())
l=list(input())
m=int(input())
for i in range(len(l)):
	if l[i]!=l[m-1]:
    	l[i]="*"
print("".join(l))
	

Fixed code:
n=int(input())
l=list(input())
m=int(input())
for i in range(len(l)):
  if l[i]!=l[m-1]:
    l[i]="*"
print("".join(l))
Buggy code:
n = int(input())
s = input()
k = int(input())

sk = s[k-1]
print(sk)

new_s = ""
for cal in s:
  if cal != sk:
    new_s += "*"
  else:
    new_s += sk
print(new_s)

Fixed code:
n = int(input())
s = input()
k = int(input())

sk = s[k-1]

new_s = ""
for cal in s:
  if cal != sk:
    new_s += "*"
  else:
    new_s += sk
print(new_s)
Buggy code:


N = int(input())
S = str(input())
K =int(input())

K_char = S[K-1]
ans = ''
for i in S:
    if i != K_char:
        ans += i
    elif  i == K_char:
        ans += '*'
        
print(ans)

Fixed code:


N = int(input())
S = str(input())
K =int(input())

K_char = S[K-1]
ans = ''
for i in S:
    if i == K_char:
        ans += i
    elif  i != K_char:
        ans += '*'
        
print(ans)
Buggy code:
from functools import reduce

N = int(input())
S = input()
K = int(input())

print(reduce(lambda x, y: x + (y if y == S[K] else '*'), S, ''))


Fixed code:
from functools import reduce

N = int(input())
S = input()
K = int(input()) - 1

print(reduce(lambda x, y: x + (y if y == S[K] else '*'), S, ''))
Buggy code:
import math
import sys
N = int(input())
s = input()
k = int(input())
t = s[k-1]
u = ""
for i in s:
    if s[i] == t:
        u += s[i]
    else :
        u += '*'
print(u)



Fixed code:
import math
import sys
N = int(input())
s = input()
k = int(input())
t = s[k-1]
u = ""
for i in s:
    if i == t:
        u += i
    else :
        u += '*'
print(u)
Buggy code:
n = int(input())
s = input()
k = int(input()) -1
d = s[k]
w = []
for i in range(n-1):
    if s[i] != d:
        w.append('*')
    else:
        w.append(d)
print(*w, sep='')

Fixed code:
n = int(input())
s = input()
k = int(input()) -1
d = s[k]
w = []
for i in range(n):
    if s[i] != d:
        w.append('*')
    else:
        w.append(d)
print(*w, sep='')
Buggy code:
A = int(input())
B = input()
C = int(input())
mark = B[C-1]
for i in range(A):
  if B[i] != mark:
    B = B.replace(B[i], '*', 1)
    print(1)

print(B)


Fixed code:
A = int(input())
B = input()
C = int(input())
mark = B[C-1]
for i in range(A):
  if B[i] != mark:
    B = B.replace(B[i], '*', 1)
    
 
print(B)
Buggy code:
a, b = map(int, input().split())
cnt = 0
for i in range(2):
  if a >= b:
    cnt += a
    a -= 1
  elif a <= b:
    cnt *= b
    b -= 1


Fixed code:
a, b = map(int, input().split())
cnt = 0
for i in range(2):
  if a >= b:
    cnt += a
    a -= 1
  elif a <= b:
    cnt += b
    b -= 1
print(cnt)
Buggy code:
a,b = map(int, input(),split())
ans = max(a + b, 2*a-1, 2*b-1)
print(ans)

Fixed code:
a,b = map(int, input().split())
ans = max(a + b, 2*a-1, 2*b-1)
print(ans)
Buggy code:
a,b = map(int,input())
m = max(a,b)
m1 = m*2-1
m2 = a+b
ans = max(m1,m2)
print(ans)

Fixed code:
a,b = map(int,input().split())
m = max(a,b)
m1 = m*2-1
m2 = a+b
ans = max(m1,m2)
print(ans)
Buggy code:
a, b = map(int, input().split())
count = 0

for range(2):
	if a>=b:
		count += a
		a -= 1
	else:
		count += b
		b -= 1

print(count)


Fixed code:

a, b = map(int, input().split())
count = 0

for i in range(2):
	if a>=b:
		count += a
		a -= 1
	else:
		count += b
		b -= 1

print(count)
Buggy code:
a,b=map(int,input().split())

lista=[]

lista.append(b)
lista.append(b-1)
lista.append(a)
lista.append(a-1)

lista.sort()
print(lista)
print(lista[-1]+lista[-2])

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

lista=[]

lista.append(b)
lista.append(b-1)
lista.append(a)
lista.append(a-1)

lista.sort()
#print(lista)
print(lista[-1]+lista[-2])
Buggy code:
a,b = map(int,input().split())
if a == b:
  print(2*a)
if a > b:
  print(2*a-1)
else:
  print(2*b-1)

Fixed code:
a,b=map(int, input().split())
print(2*a-1 if a>b else 2*b-1 if b>a else 2*a)
Buggy code:
A,B =map(int,input().split(' '))
num = 0
for i in range(2):
  if A > B:
    num += A
    A -= 1
  else:
    num += B
    B == 1
print(num)

Fixed code:
A,B =map(int,input().split(' '))
num = 0
for i in range(2):
  if A > B:
    num += A
    A -= 1
  else:
    num += B
    B -= 1
print(num)
Buggy code:
n,m = map(int,input().split())
print(n+(n-1) if n >= m else m+(m-1))

Fixed code:
n,m = map(int,input().split())
print(n+(n-1) if n > m else m+(m-1) if n < m else n+m)
Buggy code:
A,B = map(int, input().split())
count = 0
for i in range(2):
  if A>B:
    count+=A
  else:
    count+=B
print(count)

Fixed code:
A,B = map(int, input().split())
count = 0
for i in range(2):
  if A>B:
    count+=A
    A-=1
  else:
    count+=B
    B-=1
print(count)
Buggy code:
ipt=input()
lst=ipt.split()
A=lst[0]
B=lst[1]
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)


Fixed code:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)
Buggy code:
x, y = map(int, input().split())

print(max(x, y) + max(max(x, y)-1, min(x,y))

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

print(max(x, y) + max(max(x, y)-1, min(x,y)))
Buggy code:
A, B = map(int, input().split())
if A > B:
    result = A + (A - 1)
elif A < B:
    reuslt = B + (B - 1)
else:
    result = A + B
print(result)

Fixed code:
A, B = map(int, input().split())
if A > B:
    result = A + (A - 1)
elif A < B:
    result = B + (B - 1)
else:
    result = A + B
print(result)
Buggy code:
a,b = map(int,input().split())
count = 0

for i in range(2):
    if a >= b:
        count += a
        a -= 1
    else:
        count += b
        b - 1
print(count)


Fixed code:
a,b = map(int,input().split())
count = 0

for i in range(2):
    if a >= b:
        count += a
        a -= 1
    else:
        count += b
        b -= 1
print(count)
Buggy code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

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

Fixed code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

a,b = map(int,input().split())
if a == b:
    print(a*2)
else:
    print(max(a,b)*2-1)
Buggy code:
a, b = map(int, input().split())

if a == b:
  print(a * 2)
else: 
  print(a + (a-1))

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

if a == b:
  print(a * 2)
else: 
  print(2 * max(a, b) - 1)
Buggy code:
A, B = map(int, input().split())
if A != B:
    print(2*max(A, B) - 1)
else:
    print(2*A - 1)


Fixed code:
A, B = map(int, input().split())
if A != B:
    print(2*max(A, B) - 1)
else:
    print(2*A )
Buggy code:
a, b = map(int,input().split())
if a > b:
  	print(a + a - 1)
if b > a:
  	print(b + b - 1)
else:
  	print(a + b)
  	


Fixed code:
a, b = map(int,input().split())
if a > b:
  	print(a + a - 1)
elif b > a:
  	print(b + b - 1)
else:
  	print(a + b)
Buggy code:
a,b=map(int,input().split())
if a<=b:
  print(b+b-1)
else:
  print(a+a-1)

Fixed code:
a,b=map(int,input().split())
if(a<b):
  print(b+b-1)
  
elif(a==b):
  print(a+b)

else:
  print(a+a-1)
Buggy code:
A=sorted(map(int,input().split()))
print( A[1]*2-1 if A[1]+A[0]-1 <= A[1]*2-1 else A[1]+A[0]-1 )

Fixed code:
A=sorted(map(int,input().split()))
print( A[1]*2-1 if A[1]+A[0] <= A[1]*2-1 else A[1]+A[0] )
Buggy code:
a,b=map(int,input().split())
ans=max(a,b)*2
print(ans if a!=b else ans-1)

Fixed code:
a,b=map(int,input().split())
ans=max(a,b)*2
print(ans-1 if a!=b else ans)
Buggy code:
A,B = map(int,input().split())

int sum = 0

if A > B:
   sum = A+A-1
   print(sum)

if B > A:
   sum = B+B-1
   print(sum)

if B == A:
   sum = B+A
   print(sum)




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

C = 0

if A > B:
   C = A+A-1
   print(C)

if B > A:
   C = B+B-1
   print(C)

if B == A:
   C = B+A
   print(C)
Buggy code:
A,B = map(int, input().split())
C = 0

for i in range(0,2):
    print(i)
    if A >= B:
        C += A
        A -= 1
    elif A < B:
        C += B
        B -= 1
print(C)

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

for i in range(0,2):
    if A >= B:
        C += A
        A -= 1
    elif A < B:
        C += B
        B -= 1
print(C)
Buggy code:
a, b = [ int(v) for v in input().split() ]
print(max(a*b,a*(a-1),b*(b-1)))

Fixed code:
a, b = [ int(v) for v in input().split() ]
print(max(a+b,a*2-1,b*2-1))
Buggy code:
a,b=map(int,input().split())
if a>b:
  print((2*a)-1)
if a<b:
  print((2*b)-1)
else:
  print(2*a)

Fixed code:
a,b=map(int,input().split())
if a==b:
  print(2*a)
elif a>b:
  print(2*a-1)
else:
  print(2*b-1)
Buggy code:
a,b=[int(i) for i in input().split()]

print(min[2*a-1,a+b,2*b-1])

Fixed code:
a,b=[int(i) for i in input().split()]
print(max([2*a-1,a+b,2*b-1]))
Buggy code:
A,B = map(int,input().split())

goukei = 0
for i in range(2):
    if A>=B:
        goukei = goukei + A
        A = A - 1
    
    if B > A :
        goukei = goukei + B
        B = B - 1
        
print(goukei)

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

goukei = 0
for i in range(2):
    if A>=B:
        goukei = goukei + A
        A = A - 1
        continue
    
    if B > A :
        goukei = goukei + B
        B = B - 1
        continue
        
print(goukei)
Buggy code:
a,b = list(map(int,input().split()))
if a==b:
	print(a+b)
else:
	print(a*2+1 if a>b else b*2-1)

Fixed code:
a,b = list(map(int,input().split()))
if a==b:
	print(a+b)
else:
	print(a*2-1 if a>b else b*2-1)
Buggy code:
A, B = map(int, input().split()) 
sum = 0

print(A)
print(B)

if A > B:
    sum = A + (A - 1)
if B > A:
    sum = B + (B - 1)
else:
    sum = A + B

print(sum)

Fixed code:
A, B = map(int, input().split()) 
sum = 0

if A > B:
    sum = A + (A - 1)
elif B > A:
    sum = B + (B - 1)
else:  
    sum = A + B

print(sum)
Buggy code:
n=list(int(input().split()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

Fixed code:
n=list(map(int,input().split()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)
Buggy code:
a, b = list(map(int, input().split()))
if a == b:
  my_result = a + b
elif a > b:
  my_result = 2 * a + 1
else:
  my_result = 2 * b + 1
print(my_result)

Fixed code:
a, b = list(map(int, input().split()))
if a == b:
  my_result = a + b
elif a > b:
  my_result = 2 * a - 1
else:
  my_result = 2 * b - 1
print(my_result)
Buggy code:
def apply(a,b):
  if a>b:
	return a, a-1, b
  else:
    return b, a, b-1

if __name__ == '__main__':
  a,b = map(int,input().split())
  res = 0
  tmp, a, b = apply(a,b)
  res += tmp
  tmp, a, b = apply(a,b)
  res += tmp
  print(res)

Fixed code:
def apply(a,b):
  if a>b:
    return (a, a-1, b)
  else:
    return (b, a, b-1)

if __name__ == '__main__':
  a,b = map(int,input().split())
  res = 0
  tmp, a, b = apply(a,b)
  res += tmp
  tmp, a, b = apply(a,b)
  res += tmp
  print(res)
Buggy code:
a,b=map(int, input().split())
x=0
if a=b:
    print(a+b)
elif a>b:
    print(a+a-1)
else:
    print(b+b-1)

Fixed code:
a,b=map(int, input().split())
x=0
if a==b:
    x=a+b
elif a>b:
    x=a+a-1
else:
    x=b+b-1
print(x)
Buggy code:
A, B = map(int, input().split())

ans = 0

for i in range(2):
  if B > A:
    ans += B
  else:
    ans += A
 
print(ans)

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

ans = 0

for i in range(2):
  if B > A:
    ans += B
    B -= 1
  else:
    ans += A
    A -= 1
 
print(ans)
Buggy code:
a,b=map(int,input().split())


print(max(a,b)+max(max(a,b)-1),min(a,b))

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


print(max(a,b)+max(max(a,b)-1,min(a,b)))
Buggy code:
x,y=map(int,input().split())
print(max(max(x,y)*2-1,x*2)

Fixed code:
x,y=map(int,input().split())
print(max(max(x,y)*2-1,x+y))
Buggy code:
x,y=map(int,input().split())
if x!=y:
  print(max(x,y)*2)
else:
  print(x*2)

Fixed code:
x,y=map(int,input().split())
if x!=y:
  print(max(x,y)*2-1)
else:
  print(x*2)
Buggy code:
a,b = map(int,input().split())

if a > b:
    print(2*a-1)
elif a == b:
    print(a+b)
else:
    print(2*b+1)


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

if a > b:
    print(2*a-1)
elif a == b:
    print(a+b)
else:
    print(2*b-1)
Buggy code:
a,b=map(int,input().split())

if a=b:
  print(2*a)
  
else:
  print(2*max(a,b)-1)

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

if a==b:
  print(2*a)
  
else:
  print(2*max(a,b)-1)
Buggy code:
a,b=map(int,input().split())
if a>b:
    m+=a
    a=a-1
m+=max(a,b)
print(m)

Fixed code:
a,b=map(int,input().split())
m=0
if a>b:
    m+=a
    a=a-1
else:
    m+=b
    b=b-1
m+=max(a,b)
print(m)
Buggy code:
a, b = map(int, input().split())

if a == b:
  print(2 * a)
elif a < b:
  print(a + a - 1)
else:
  print(b + b - 1)

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

if a == b:
  print(2 * a)
elif a < b:
  print(b + b - 1)
else:
  print(a + a - 1)
Buggy code:
a,b = map(int, input().split())
if a == b:
    print(2*a)
else:
    print(2*a-1)

Fixed code:
a,b = map(int, input().split())
if a == b:
    print(2*a)
else:
    print(2*max(a,b)-1)
Buggy code:
a, b = int(_) for _ in input().split()
if a - 2 > b:
  print(a*2)
elif b - 2 > a:
  print(b*2)
else:
  print(a+b)

Fixed code:
a, b = (int(_) for _ in input().split())
if a - 2 >= b:
  print(a*2 -1)
elif b - 2 >= a:
  print(b*2 -1)
else:
  print(a+b)
Buggy code:
i = list(map(int, input().split()))
if i[0]>i[1] and i[0]-i[1]>=2:
	print(2*(i[0])-1)
elif i[1]>i[0] and i[1]-i[0]>=2:
	print(2*(i[1])-1)
else:
	i[1]+i[0]

Fixed code:
i = list(map(int, input().split()))
if i[0]>i[1] and i[0]-i[1]>=2:
	print(2*(i[0])-1)
elif i[1]>i[0] and i[1]-i[0]>=2:
	print(2*(i[1])-1)
else:
	print(i[1]+i[0])
Buggy code:
def money(A, B):
    if A<B:
        return 2*B-1
    elif A>B:
        return 2*A-1
    else:
        return A+B

A,B = map(int, input().split())
coin = money(A,B)

Fixed code:
def money(A, B):
    if A<B:
        return 2*B-1
    elif A>B:
        return 2*A-1
    else:
        return A+B

A,B = map(int, input().split())
coin = money(A,B)

print(coin)
Buggy code:
a, b = map(int, input().split())
print(max(a,b) + max(max(a,b)-1, min(a,b))


Fixed code:
a, b = map(int, input().split())
print(max(a,b) + max(max(a,b)-1, min(a,b)))
Buggy code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    
    print(A + A -1 if A > B else B + B -1)
   
if __name__ == '__main__':
    main()

Fixed code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
    
    ans = 0
    
    if A > B:
        ans = A + A - 1
    elif A == B:
        ans = A + B
    else:
        ans = B + B - 1
    
    print(ans)
   
if __name__ == '__main__':
    main()
Buggy code:
A, B = map(int, input().split())
c = 0

for _ in range(2):
    print(A, B, max(A, B))
    c += max(A, B)
    if max(A, B) == A:
        A = A - 1
    elif max(A, B) == B:
        B = B - 1

print(c)

Fixed code:
A, B = map(int, input().split())
c = 0

for _ in range(2):
    c += max(A, B)
    if max(A, B) == A:
        A = A - 1
    elif max(A, B) == B:
        B = B - 1

print(c)
Buggy code:
a,b = map(int,input().split())
ans = 0
for i in range(N):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

Fixed code:
a,b = map(int,input().split())
ans = 0
for i in range(2):
  if a>=b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)
Buggy code:
A, B = map(int, input().split(" "))
if A < B:
    print(B * (B - 1))
elif A == B:
    print(A * 2)
else:
    print(A * (A - 1))

Fixed code:
A, B = map(int, input().split(" "))
if A < B:
    print(B + (B - 1))
elif A == B:
    print(A * 2)
else:
    print(A + (A - 1))
Buggy code:
A,B = int(input().split())
coin = 0
for i in range (2):
  if A>B:
    coin+=A
  else:
    coin+=B
    
print(coin)


Fixed code:
A,B = input().split()
A= int(A)
B= int(B)
coin = 0
for i in range (2):
  if A>B:
    coin += A
    A-=1
  else:
    coin += B
    B-=1
    
print(coin)
Buggy code:
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
      A-=1
   else:
      sum+=B
      B-=1
print(sum)

Fixed code:
A,B=map(int,input().split())
sum =0
for i in range(2):
  if A >= B:
     sum+=A
     A-=1
  else:
     sum+=B
     B-=1
print(sum)
Buggy code:
a, b = map(int, input().split())

def Buttons(x, y):
  if x > y:
    return 2*x-1
  elif x < y:
    return 2*y-1
  elif x==y:
    return x+y


Buttons(a,b)

Fixed code:
a, b = map(int, input().split())
 
def Buttons(x, y):
  if x > y:
    return 2*x-1
  elif x < y:
    return 2*y-1
  else:
    return x+y
 
 
print(Buttons(a,b))
Buggy code:
a=map(int,input().split())
print(max([2*a[0]-1,2*a[1]-1,a[0]+a[1]])

Fixed code:
a=list(map(int,input().split()))
print(max([2*a[0]-1,2*a[1]-1,a[0]+a[1]]))
Buggy code:
A,B = map(int,input().split())
if abs(a-b)<=1:
  print(a+b)
else:
  if a>b:
    print(a*2-1)
  else:
    print(b*2-1)
    

Fixed code:
a,b = map(int,input().split())
if abs(a-b)<=1:
  print(a+b)
else:
  if a>b:
    print((a*2)-1)
  else:
    print((b*2)-1)
Buggy code:
a,b = map(int,input().split(" "))


print(max(a+a-1,b+b-1,a+br))

Fixed code:

a,b = map(int,input().split(" "))


print(max(a+a-1,b+b-1,a+b))
Buggy code:
A, B = map(int, input().split())

print(max(A, B) * 2 - (1 if A == B else 0))


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

print(max(A, B) * 2 - (1 if A != B else 0))
Buggy code:
a,b = map(int, input().split())
print(max([max([a,b]) * 2 -1, a+b])

Fixed code:
a,b = map(int, input().split())
larger = max([a,b])
print(max([larger*2-1, a+b]))
Buggy code:
A,B=map(int, input().split())
if A-B>=2:
  print(2*A-1)
elif A=B:
  print(A+B)
else:
  print(2*B-1)

Fixed code:
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*B-1)
Buggy code:
a, b = map(int, input().split())

res = 0 3
for i in range(2):
    if a > b:
        res += a
        a -= 1
    else:
        res += b
        b -= 1

print(res)


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

res = 0
for i in range(2):
    if a > b:
        res += a
        a -= 1
    else:
        res += b
        b -= 1

print(res)
Buggy code:
a,b=map(int, input().split()) 
max1 = max(a,b)
max2 = max(max(a,b), min(a,b)-1)

print(max1+max2)

Fixed code:
a,b=map(int, input().split()) 
max1 = max(a,b)
max2 = max(min(a,b), max(a,b)-1)
 
print(max1+max2)
Buggy code:
a,b =map(int, input().split())
if a>b:
  c==a+a-1
elif a=b:
  c==a+b
else:
  c==b+b-1
print(c)

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

c = 0

if(a>=b):
  c += a
  a -= 1
else:
  c += b
  b -= 1

if(a>=b):
  c += a
  a -= 1
else:
  c += b
  b -= 1
print(c)
Buggy code:
a, b = (int(i) for i in input().split())
if abs(a-b) > 1:
  print(max(a,b)*2 - 1)
else:
  print(a*2)

Fixed code:
a, b = (int(i) for i in input().split())
if a == b:
  print(max(a,b)*2)
else:
  print(max(a,b)*2 - 1)
Buggy code:
A,B=map(int,input().split())
if A>=B+1:
  print(A+A-1)
elif A-1==B:
  print(A+B)
elif B>=A+1:
  print(B+B-1)
elif B-1==A:
  print(A+B)

Fixed code:
A,B=map(int,input().split())
if A>B+1:
  print(A+A-1)
elif A-1==B:
  print(A+B)
elif B>A+1:
  print(B+B-1)
elif B-1==A:
  print(A+B)
else:
  print(A+B)
Buggy code:
AB = int(input().split())
A,B=AB[0], AB[1]
if max(A,B)-min(A,B) >= 1:
  print(2*max(A,B)-1)
else:
  print(A+B)

Fixed code:
AB = input().split()
A,B=int(AB[0]), int(AB[1])
if max(A,B)-min(A,B) >= 1:
  print(2*max(A,B)-1)
else:
  print(A+B)
Buggy code:
A, B = list(map(int,input().split()))

SUM = 0
for i in range(2):
  if A >= B:
    SUM = SUM + A
    A -= A
  else:
    SUM = SUM + B
    B -= B
  
print(SUM)    

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

SUM = 0
for i in range(2):
  if A >= B:
    SUM = SUM + A
    A = A - 1
  else:
    SUM = SUM + B
    B = B - 1

print(SUM)
Buggy code:
A, B = map(int, input().split())

pattern1 = A+A-1
pattern2 = A+B-1
pattern3 = B+B-1

print(max(pattern1, pattern2, pattern3))

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

pattern1 = A+A-1
pattern2 = A+B
pattern3 = B+B-1

print(max(pattern1, pattern2, pattern3))
Buggy code:
A,B=map(int,input().split())
lst=[A,A-1,B,B-1]
lst.sort()
print(lst)
print(lst[-1]+lst[-2])

Fixed code:
A,B=map(int,input().split())
lst=[A,A-1,B,B-1]
lst.sort()
print(lst[-1]+lst[-2])
Buggy code:
a,b = map(int, input())
if a < b:
  tmp = b
  b = a
  a = tmp

if a-1 >= b:
  ans = a + a - 1
else :
  ans = a+b
  
print(ans)
	
  

Fixed code:
a,b = map(int, input().split())
if a < b:
  tmp = b
  b = a
  a = tmp

if a-1 >= b:
  ans = a + a - 1
else :
  ans = a+b
  
print(ans)
Buggy code:
a = list(map(int, input().split()))
a.append(a[0]-1)
a.append(a[1]-1)
a.sort()
pirnt(a[-1]+ a[-2])



Fixed code:
a = list(map(int, input().split()))
a.append(a[0]-1)
a.append(a[1]-1)
a.sort()
print(a[-1]+ a[-2])
Buggy code:
A, B = map(int, input().split())

answer = 0
if A >= B:
  answer += A
  A -= 1
else:
  answer += B
  B -= 1
answer = 0
if A >= B:
  answer += A
else:
  answer += B

print(answer)

Fixed code:
A, B = map(int, input().split())
 
answer = 0
if A >= B:
  answer += A
  A -= 1
else:
  answer += B
  B -= 1
if A >= B:
  answer += A
else:
  answer += B
 
print(answer)
Buggy code:
b = list(map(int, input().split()))
if b[0]==b[1]:
    print(2*b[0]-1)
else:
    print(2*max(b)-1)

Fixed code:
b = list(map(int, input().split()))
if b[0]==b[1]:
    print(2*b[0])
else:
    print(2*max(b)-1)
Buggy code:
if __name__ == "__main__":
    p, q = input().split()
    if p > q:
        answer = p
        p = p - 1
    else:
        answer = q
        q = q - 1
    if p > q:
        answer += p
    else:
        answer += q
    

Fixed code:
if __name__ == "__main__":
    p, q = input().split()
    p = int(p)
    q = int(q)
    if p > q:
        answer = p
        p = p - 1
    else:
        answer = q
        q = q - 1
    if p > q:
        answer += p
    else:
        answer += q
    print(answer)
Buggy code:
A,B = map(int,input().split())
if A > B:
    print(int(A) + int(A) - 1)
elif B > A:
    print(int(B) + int(B) - 1)
else A = B:
    print(int(A) + int(A))

Fixed code:
A, B = map(int,input().split())
if A > B:
    print(int(A) + int(A) - 1)
elif B > A:
    print(int(B) + int(B) - 1)
else:
    print(int(A) + int(A))
Buggy code:
a,b=map(int,input().split())
print(max(2*a-1,a*b,2*b-1))

Fixed code:
a,b=map(int,input().split())
print(max(2*a-1,a+b,2*b-1))
Buggy code:
a,b=map(int,input().split())
if a>b and a-b>2:
  print(2*a-1)
elif a>b and a-b<2:
  print(a+b)
elif b>a and b-a>2:
  print(2*b-1)
elif b>a and b-a<2:
  print(a+b)
elif a==b:
  print(a+b)

Fixed code:
a,b=map(int,input().split())
if a>b and a-b>=2:
  print(2*a-1)
elif a>b and a-b<2:
  print(a+b)
elif b>a and b-a>=2:
  print(2*b-1)
elif b>a and b-a<2:
  print(a+b)
elif a==b:
  print(a+b)
Buggy code:
A,B = map(int,input().rstrip().split())
if A == B:
    print(A*A)
else:
    print(max(A,B) + (max(A,B) - 1)

Fixed code:
A,B = map(int,input().rstrip().split())
if A == B:
    print(A + A)
else:
    print(max(A,B) + (max(A,B) - 1))
Buggy code:
A, B = map(int, imput().split())
i = 0

for j in range(2):
	if A > B:
	  i += A
	  A -= 1
	else:
	  i += B
	  B -= 1

print(i)

Fixed code:
A, B = map(int, input().split())
i = 0
 
for j in range(2):
	if A > B:
	  i += A
	  A -= 1
	else:
	  i += B
	  B -= 1
 
print(i)
Buggy code:
a, b = map(int, input().split())
if a >= b + 1:
  print(a + a -1)
elif a = b:
  print(a + b)
else:
  print(b + b - 1)

Fixed code:
a, b = map(int, input().split())
if a > b :
  print(a + a -1)
elif a == b:
  print(a + b)
else:
  print(b + b - 1)