qyliang/CodeNanoFix huggingface dataset:
Buggy code:
from sys import stdin

N=int(input())
xlist=[]
ylist=[]
dict = {}
for i in range(N):
  x, y = map(int, stdin.readline().rstrip().split())
  xlist.append(x)
  ylist.append(y)

for i in range(N):
  for j in range(N):
    if i != j:
      tupleStr=str(xlist[i] - xlist[j])+","+str(ylist[i] - ylist[j])
      if tupleStr in dict:
        dict[tupleStr]+=1
      else:
        dict[tupleStr]=1

#maxNum = max(dict.values())
maxNum=2
print(N-maxNum)


Fixed code:
from sys import stdin

N=int(input())
xlist=[]
ylist=[]
dict = {}
for i in range(N):
  x, y = map(int, stdin.readline().rstrip().split())
  xlist.append(x)
  ylist.append(y)

for i in range(N):
  for j in range(N):
    if i != j:
      tupleStr=str(xlist[i] - xlist[j])+","+str(ylist[i] - ylist[j])
      if tupleStr in dict:
        dict[tupleStr]+=1
      else:
        dict[tupleStr]=1

maxNum=0
for val in dict.values():
  maxNum = max(maxNum, val)

print(N-maxNum)
Buggy code:
import sys
input = sys.stdin.readline

def f(_pts, p, q):
    pts = set(_pts[:])
    r = 0

    while len(pts) > 0:
        r += 1
        x = max(pts)
        while x in pts:
            pts.remove(x)
            x = (x[0]-p, x[1]-q)

    return r

################################################################################

n = int(input())
pts = []
for i in range(n):
    x, y = map(int, input().split())
    pts.append((x, y))

res = n
for i in range(len(pts)):
    for j in range(i+1, len(pts)):
        l = f(pts, -(pts[i][0]-pts[j][0]), -(pts[i][1]-pts[j][1]))
        l = f(pts, +(pts[i][0]-pts[j][0]), -(pts[i][1]-pts[j][1]))
        l = f(pts, -(pts[i][0]-pts[j][0]), +(pts[i][1]-pts[j][1]))
        l = f(pts, +(pts[i][0]-pts[j][0]), +(pts[i][1]-pts[j][1]))
        res = min(res, l)

print(res)

Fixed code:
import sys
input = sys.stdin.readline
 
def f(_pts, p, q):
    pts = set(_pts[:])
    r = 0
 
    while len(pts) > 0:
        r += 1
        x = max(pts)
        while x in pts:
            pts.remove(x)
            x = (x[0]-p, x[1]-q)
 
    return r
 
################################################################################
 
n = int(input())
pts = []
for i in range(n):
    x, y = map(int, input().split())
    pts.append((x, y))
 
res = n
for i in range(len(pts)):
    for j in range(i+1, len(pts)):
        res = min(res, f(pts, -(pts[i][0]-pts[j][0]), -(pts[i][1]-pts[j][1])))
        res = min(res, f(pts, +(pts[i][0]-pts[j][0]), -(pts[i][1]-pts[j][1])))
        res = min(res, f(pts, -(pts[i][0]-pts[j][0]), +(pts[i][1]-pts[j][1])))
        res = min(res, f(pts, +(pts[i][0]-pts[j][0]), +(pts[i][1]-pts[j][1])))
 
print(res)
Buggy code:
n = int(input())
if n = 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
    

Fixed code:
n = int(input())
if n == 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
Buggy code:
N = int(input())
List = [list(map(int,input().split())) for i in range(N)]

import copy

List.sort(key=lambda x:x[0])

result = float('inf')

for i in range(N):
    for j in range(N-i):
        p = List[i+j][0] - List[i][0]
        q = List[i+j][1] - List[i][1]
        if p == 0:
            p = 1
        if q == 0:
            q = 1
        tmp_list = copy.deepcopy(List)
        cost = 0
        
        for k in range(N):
            if [tmp_list[0][0] + p, tmp_list[0][1] + q] in List:
                tmp_cost = 0
            else:
                tmp_cost = 1
            cost += tmp_cost
            del tmp_list[0]
            
        if result > cost:
            result = cost
                    
print(result)

Fixed code:
N = int(input())
List = [list(map(int,input().split())) for i in range(N)]

import copy

List.sort(key=lambda x:x[0])

result = float('inf')


for i in range(N):
    if N == 1:
        result = 1
        break
    for j in range(N-i-1):
        p = List[i+j+1][0] - List[i][0]
        q = List[i+j+1][1] - List[i][1]
        tmp_list = copy.deepcopy(List)
        cost = 0
        
        for k in range(N):
            if [tmp_list[0][0] + p, tmp_list[0][1] + q] in List:
                tmp_cost = 0
            else:
                tmp_cost = 1
            cost += tmp_cost
            del tmp_list[0]
        if result > cost:
            result = cost
                    
print(result)
Buggy code:
n = int(input())

a = [list(map(int,input().split())) for _ in range(n)]

lst = []

for i in range(n):
    for j in range(i,n):
        if a[j][0]-a[i][0] <= 0 and a[j][1]-a[i][1] <= 0:
            lst.append([a[i][0]-a[j][0], a[i][1]-a[j][1]])
        else:
            lst.append([a[j][0]-a[i][0], a[j][1]-a[i][1]])

if n ==1:
    print(1)
else:
    x = 0
    for i in range(len(a)):
        c = 0
        for j in range(i,len(a)):
            if a[i] == a[j]:
                c += 1
        x = max(x,c)
    print(n-x-1)

Fixed code:
n = int(input())

a = [list(map(int,input().split())) for _ in range(n)]

lst = []

for i in range(n):
    for j in range(i+1,n):
        if a[j][0]-a[i][0] < 0:
            lst.append([a[i][0]-a[j][0], a[i][1]-a[j][1]])
        if a[j][0]-a[i][0] == 0:
            lst.append([a[i][0]-a[j][0], abs(a[i][1]-a[j][1])])
        else:
            lst.append([a[j][0]-a[i][0], a[j][1]-a[i][1]])

if n ==1:
    print(1)
else:
    x = 0
    for i in range(len(lst)):
        c = 1
        for j in range(i+1,len(lst)):
            if lst[i] == lst[j]:
                c += 1
        x = max(x,c)
    print(n-x)
Buggy code:
n = int(input())
a = [tuple(map(int, input().split())) for i in range(n)]
t = set(a)
minans = 1000000000000
for i in range(n):
    for j in range(i + 1, n):
        r = t.copy()
        p = a[i][0] - a[j][0]
        q = a[i][1] - a[j][1]
        curans = 0
        while r:
            curans += 1
            m = r.pop()
            z = m.copy()
            while (m[0] + p, m[1] + q) in r:
                m = (m[0] + p, m[1] + q)
                r.remove(m)
            m = z.copy()
            while (m[0] - p, m[1] - q) in r:
                m = (m[0] - p, m[1] - q)
                r.remove(m)
        minans = min(minans, curans)
print(minans)


Fixed code:
n = int(input())
a = [tuple(map(int, input().split())) for i in range(n)]
t = set(a)
assert len(t) == len(a)
minans = 1000000000000
for i in range(n):
    for j in range(i + 1, n):
        r = t.copy()
        p = a[i][0] - a[j][0]
        q = a[i][1] - a[j][1]
        curans = 0
        while r:
            curans += 1
            m = r.pop()
            z = m
            while (m[0] + p, m[1] + q) in r:
                m = (m[0] + p, m[1] + q)
                r.remove(m)
            m = z
            while (m[0] - p, m[1] - q) in r:
                m = (m[0] - p, m[1] - q)
                r.remove(m)
        minans = min(minans, curans)
if minans == 1000000000000:
    print(1)
else:
    print(minans)
Buggy code:
n=int(input())

pts=[]
for i in range(n):
    pts.append(tuple(map(int,input().split())))

diffs={}
for i in range(n-1):
    for j in range(i+1,n):
        dx=pts[i][0]-pts[j][0]
        dy=pts[i][1]-pts[j][1]
        if dx<0 :
            dx=-dx
            dy=-dy
        key="{},{}".format(dx,dy)
        if key in diffs:
            diffs[key]+=1
        else:
            diffs[key]=1

max=1
maxkey=""
for k,v in diffs.items():
    if v>max:
        max=v
        maxkey=k

if max<2:
    print(n)
else:
    print(n-max)


Fixed code:
n=int(input())

pts=[]
for i in range(n):
    pts.append(tuple(map(int,input().split())))

diffs={}
for i in range(n-1):
    for j in range(i+1,n):
        dx=pts[i][0]-pts[j][0]
        dy=pts[i][1]-pts[j][1]
        if dx<0 :
            dx=-dx
            dy=-dy
        elif dx==0 and dy<0:
            dy=-dy
        key="{},{}".format(dx,dy)
        if key in diffs:
            diffs[key]+=1
        else:
            diffs[key]=1

max=0
maxkey=""
for k,v in diffs.items():
    if v>max:
        max=v
        maxkey=k
        
print(n-max)
Buggy code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict, Counter
import bisect

sys.setrecursionlimit(10000000)

n = SI()
xy = [(0,0) for _ in range(n)]
div = defaultdict(int)
for i in range(n):
    x, y = LI()
    xy[i] = (x, y)
if n==1:
    print(1)
    return 
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            div["{}_{}".format(xy[i][0] - xy[j][0], xy[i][1]- xy[j][1])] += 1

max_ = max(div.values())
print(n - max_)

Fixed code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return int(input())
from collections import defaultdict, Counter
import bisect

sys.setrecursionlimit(10000000)

n = SI()
xy = [(0,0) for _ in range(n)]
div = defaultdict(int)
for i in range(n):
    x, y = LI()
    xy[i] = (x, y)
if n==1:
    print(1)
else:
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            else:
                div["{}_{}".format(xy[i][0] - xy[j][0], xy[i][1]- xy[j][1])] += 1

    max_ = max(div.values())
    print(n - max_)
Buggy code:
words = lambda t : list(map(t, input().split()))
n = int(input())
xys = []
for i in range(n):
    (x,y) = words(int)
    xys.append((x,y))

min_score = -1
for i in range(n):
    xy1 = xys[i]
    for j in range(i,n):
        a = set(xys)
        xy2 = xys[j]
        p = xy1[0] - xy2[0]
        q = xy1[1] - xy2[1]
        score = 0
        while len(a) > 0:
            score += 1
            (x,y) = a.pop()
            xup = x + p
            yup = y + q
            while (xup,yup) in a:
                a.remove((xup,yup))
                xup = xup + p
                yup = yup + q
            xdn = x - p
            ydn = y - p
            while (xdn,ydn) in a:
                a.remove((xdn,ydn))
        if min_score == -1:
            min_score = score
        else:
            min_score = min(min_score,score)
print(min_score)


Fixed code:
words = lambda t : list(map(t, input().split()))
n = int(input())
xys = []
for i in range(n):
    (x,y) = words(int)
    xys.append((x,y))

min_score = -1
for i in range(n):
    xy1 = xys[i]
    for j in range(i,n):
        a = set(xys)
        xy2 = xys[j]
        p = xy1[0] - xy2[0]
        q = xy1[1] - xy2[1]
        score = 0
        while len(a) > 0:
            score += 1
            (x,y) = a.pop()
            xup = x + p
            yup = y + q
            while (xup,yup) in a:
                a.remove((xup,yup))
                xup += p
                yup += q
            xdn = x - p
            ydn = y - q
            while (xdn,ydn) in a:
                a.remove((xdn,ydn))
                xdn -= p
                ydn -= q
        if min_score == -1:
            min_score = score
        else:
            min_score = min(min_score,score)
print(min_score)
Buggy code:
n=int(input())
s=[]
d=[]
i=0
while i!=n:
    s=list(map(int,input().split()))
    d.append(s)
    i+=1
#print(d)
i=0
f=[]
s=[]
j=0
try:
    while i!=n:
        while j!=n:
            if i!=j:
                f.append(d[i][0]-d[j][0])
                f.append(d[i][1] - d[j][1])
                s.append(f)
                f=[]
    
            j += 1
        i+=1
        j=0
except:
    break

#print(s)
i=0
f=[]
while i!=len(s):
    f.append(s.count(s[i]))
    i+=1
#print(f)
print(int(n-max(f)))


Fixed code:
n=int(input())
s=[]
d=[]
i=0
while i!=n:
    s=list(map(int,input().split()))
    d.append(s)
    i+=1
#print(d)
i=0
f=[]
s=[]
j=0
while i!=n:
    while j!=n:
        if i!=j:
            f.append(d[i][0]-d[j][0])
            f.append(d[i][1] - d[j][1])
            s.append(f)
            f=[]

        j += 1
    i+=1
    j=0


#print(s)
i=0
f=[]
while i!=len(s):
    f.append(s.count(s[i]))
    i+=1
#print(f)
try:
    print(int(n-max(f)))
except:
    print(1)
Buggy code:
N = int(input())
if N == 1:
    return 1
points = []
for _ in range(N):
    x, y = map(int, input().split())
    points.append((x, y))
diff = dict()
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        x1, y1 = points[i]
        x2, y2 = points[j]
        pq = x1-x2, y1-y2
        diff[pq] = diff.get(pq, 0) + 1
val, key = max((v, k) for k, v in diff.items())
print(N-val)


Fixed code:
N = int(input())
if N == 1:
    print(1)
    quit()
points = []
for _ in range(N):
    x, y = map(int, input().split())
    points.append((x, y))
diff = dict()
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        x1, y1 = points[i]
        x2, y2 = points[j]
        pq = x1-x2, y1-y2
        diff[pq] = diff.get(pq, 0) + 1
val, key = max((v, k) for k, v in diff.items())
print(N-val)
Buggy code:
P, Q, R = map(int, input().split())

list = [P, Q, R]
min1 = min(list)
list.pop(min1)
min2 = min(list)
print(min1 + min2)

Fixed code:
P, Q, R = map(int, input().split())

list = [P, Q, R]
min1 = min(list)
list.remove(min1)
min2 = min(list)
print(min1 + min2)
Buggy code:
ary = list(map(lambda n: int(n), input().split(" "))).sort(reverse=True)

print(ary[0] + ary[1])

Fixed code:
ary = list(map(lambda n: int(n), input().split(" ")))
ary.sort()

print(ary[0] + ary[1])
Buggy code:
P, Q, R = map(int, input().split())

if P + Q < Q + R and P + Q < R + P:
    print(P + Q)
elif Q + R < P + Q and Q + R < R + P:
    print(Q + R)
else:
    print(R + P)
    

Fixed code:
P, Q, R = map(int, input().split())

if P + Q <= Q + R and P + Q <= R + P:
    print(P + Q)
elif Q + R <= P + Q and Q + R <= R + P:
    print(Q + R)
else:
    print(R + P)
Buggy code:
P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < max_:
    min_ = j

print(min_)

Fixed code:
P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < min_:
    min_ = j
print(min_)
Buggy code:
pqr = input().split()
for i in range(3):
     pqr[i] = int(pqr[i])
a = min(pqr[0]*pqr[1], pqr[1]*pqr[2], pqr[2]*pqr[0])
print(a)


Fixed code:
pqr = input().split()
for i in range(3):
     pqr[i] = int(pqr[i])
a = min(pqr[0]+pqr[1], pqr[1]+pqr[2], pqr[2]+pqr[0])
print(a)
Buggy code:
p, q, r = map(int, input().split())
print(p+q+r-min(p, q, r))

Fixed code:
p,q,r = map(int,input().split())

print(min(p+q,q+r,r+p))
Buggy code:
p, q, r = map(int, input().split())

print(p + q + r - map(p, q, r))

Fixed code:
p,q,r=map(int, input().split())

print(p+q+r-max(p,q,r))
Buggy code:
l = list(map(int,input().split()))
a = l.pop(min(l))
b = l.pop(min(l))
print(a+b)

Fixed code:
l = list(map(int,input().split()))
a = l.pop(l.index(min(l)))
b = l.pop(l.index(min(l)))
print(a+b)
Buggy code:
print(sum(sorted(list(map(int,input().split())[:2]))))

Fixed code:
print(sum(sorted(list(map(int,input().split())))[:2]))
Buggy code:
*A = map(int,input().split())
A.sort()
print(A[0]+A[1])

Fixed code:
*A, = map(int,input().split())
A.sort()
print(A[0]+A[1])
Buggy code:
n=[int(i) for i in input().split]
n.sort()
print(n[0]+n[1])

Fixed code:
n=[int(i) for i in input().split()]
n.sort()
print(n[0]+n[1])
Buggy code:
L=list(map(int,input().split()))
	print(sum(L)-max(L))

Fixed code:
L=list(map(int,input().split()))
print(sum(L)-max(L))
Buggy code:
P,Q,R = map(int.input().split())
 
print(min(P+Q,Q+R,R+P))

Fixed code:
P,Q,R = list(map(int,input().split()))
print(min(P+Q,Q+R,R+P))
Buggy code:
P, Q, R = map(int, input().split())
print(min(min(P + Q, PL R), Q + R)

Fixed code:
P, Q, R = map(int, input().split())
print(min(min(P + Q , P + R), Q + R))
Buggy code:
p,q,r = map(int, input().split())
print(min(p+q, r))

Fixed code:
p,q,r = map(int,input().split())
print(min(min(p+q,q+r),p+r))
Buggy code:
P, Q, R = map(int,input().split())
 
PQ = P + Q
QR = Q + R
RP = R + Q

temp1 = min(PQ, QR)
temp2 = min(temp2, RP)

print(temp2)

Fixed code:
P, Q, R = map(int,input().split())
 
PQ = P + Q
QR = Q + R
RP = R + P

temp1 = min(PQ, QR)
temp2 = min(temp1, RP)

print(temp2)
Buggy code:
P,Q,R = int(input().split())
print(min(P+Q,P+R,Q+R))

Fixed code:
P,Q,R = map(int,input().split())
print(min(P+Q,Q+R,R+P))
Buggy code:
p = list(map(int, input().split()))
print(p[0] + p[1] + [2] - max(p))


Fixed code:
p = list(map(int, input().split()))
print(p[0] + p[1] + p[2] - max(p))
Buggy code:
p,q,r = map(int, input().split())

print(min(p+q,q+r,r+p)

Fixed code:
p, q, r = map(int, input().split())

ans = min(p+q, q+r, r+p)
print(ans)
Buggy code:
p,q,r = map(int,input().split())
print(p + q + r)

Fixed code:
p,q,r, = map(int,input().split())
print(min(p+q,p+r,r+q))
Buggy code:
def main17():
    data = input().split()
    num = []
    for i in range(3):
        num.append(int(data[i]))
    num2 = []
    num2.append((num[0]+num[1]))
    num2.append((num[0]+num[2]))
    num2.append((num[2]+num[1]))
    print((max(num2)))

if __name__ == "__main__":
    main17()

Fixed code:
def main17():
    data = input().split()
    num = []
    for i in range(3):
        num.append(int(data[i]))
    num2 = []
    num2.append((num[0]+num[1]))
    num2.append((num[0]+num[2]))
    num2.append((num[2]+num[1]))
    print((min(num2)))

if __name__ == "__main__":
    main17()
Buggy code:
time = list(map(int, input(),split()))
sum = time[0] + time[1]
if sum > time[1] + time[2]:
  sum = time[1] + time[2]
if sum > time[0] + time[2]:
  sum = time[0] + time[2]
print(sum)
 

Fixed code:
time = list(map(int, input().split()))
sum = time[0] + time[1]
if sum > time[1] + time[2]:
  sum = time[1] + time[2]
if sum > time[0] + time[2]:
  sum = time[0] + time[2]
print(sum)
Buggy code:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(d.min())

Fixed code:
i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))
Buggy code:
p,q,r=map(int,input().split())
print(min(p+q,r))

Fixed code:
p,q,r=map(int,input().split())
print(min((p+q),(p+r),(q+r)))
Buggy code:
def main():
    PQR = list(map(int, input().split()))
    newPQR = sorted(PQR)
    print(newPQR)
    arr = newPQR[:2]
    print(arr[0]+arr[1])
main()

Fixed code:
def main():
    PQR = list(map(int, input().split()))
    newPQR = sorted(PQR)
    arr = newPQR[:2]
    print(arr[0]+arr[1])
main()
Buggy code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
P, Q, R = map(int, input().split())
# A = list(map(int, input().split()))

print(min(P + Q, R, P + R, Q + R, 2 * P + Q, 2 * Q + R))

Fixed code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
P, Q, R = map(int, input().split())
# A = list(map(int, input().split()))

print(min(P + Q, R + Q, R + P))
Buggy code:
p, q, r = map(int, input().split())
print(min([p + q, q + r. r + p]))

Fixed code:
p, q, r = map(int, input().split())
print(min([p + q, q + r, r + p]))
Buggy code:
import sys
data = sys.stdin.readlines()
print(data[0].split())
inputs = [int(x) for x in data[0].split()]
inputs.sort()
print(inputs[0] + inputs[1])

Fixed code:
import sys
data = sys.stdin.readlines()
inputs = [int(x) for x in data[0].split()]
inputs.sort()
print(inputs[0] + inputs[1])
Buggy code:
print(min([sum(l) - l[i] for i in range(len(list(map(int, input().split()))))]))

Fixed code:
l = list(map(int, input().split()))
print(min([sum(l) - l[i] for i in range(len(l))]))
Buggy code:
a,b,c = map(int,input().split)
print(min(a+b,a+c,b+c)

Fixed code:
a,b,c = map(int,input().split())
print(min(a+b,a+c,b+c))
Buggy code:
a = list(map(int,input().split())
a.sort()
print(a[0]+a[1])

Fixed code:
a=list(map(int, input().split()))
a.sort()
print(a[0]+a[1])
Buggy code:
P,Q,R = list(map(int, input().split()))
print(min(P,Q)+min(Q,R))


Fixed code:
P,Q,R = map(int, input().split())
print(min(P+Q,Q+R,R+P))
Buggy code:
a,b,c =input().split(",")
mylist = [int(a),int(b),int(c)]
mylist.sort()
print(sum(mylist[0:2]))

Fixed code:
a,b,c =input().split(" ")
mylist = [int(a),int(b),int(c)]
mylist.sort()
print(sum(mylist[0:2]))
Buggy code:
def main():
    p, q, r = map(int, input().split)
    min_time = min([p+q, q+r, r+p])
    print(min_time)

if __name__ == '__main__':
	main()

Fixed code:
def main():
    p,q,r = map(int, input().split())
    min_time = min([p+q, q+r, r+p])
    print(min_time)

if __name__ == '__main__':
	main()
Buggy code:
p,q,r=map(int,input().split())
print(min(p+q,q+r,r+p)

Fixed code:
p,q,r = map(int,input().split())
print(min(p+q, q+r, r+p))
Buggy code:
y=input().split()
for i in range(len(y)):
    y[i]=int(y[i])
a=[]
a.append(y[0]+y[1])
a.append(y[2]+y[1])
a.append(y[0]+y[2])
a.sort()
print(a[1])

Fixed code:
y=input().split()
for i in range(len(y)):
    y[i]=int(y[i])
a=[]
a.append(y[0]+y[1])
a.append(y[2]+y[1])
a.append(y[0]+y[2])
a.sort()
print(a[0])
Buggy code:
data = list(map(int, input().split()))
n = len(data)
res = 0
for i in range(n-1):
  for j in range(i, n):
    if data[i] + data[j] < res:
      res = data[i] + data[j]
print(res)
    

Fixed code:
data = list(map(int, input().split()))
n = len(data)
res = 300
for i in range(n-1):
  for j in range(i+1, n):
    if data[i] + data[j] < res:
      res = data[i] + data[j]
print(res)
Buggy code:
L=list(map(int,input().split))
L.sort()
print(L[0]+L[1])

Fixed code:
L= list(map(int, input().split()))
L.sort()
print(L[0]+L[1])
Buggy code:
dists = sorted(list(map(int, input().split())))

dists.pop()
print(dists)

Fixed code:
dists = sorted(list(map(int, input().split())))

dists.pop()
print(sum(dists))
Buggy code:
def main():
    a,b,c=map(int,input().split(' '))
    print(sum([a,b,c])-,max(a,b,c))

main()


Fixed code:
def main():
    a,b,c=map(int,input().split(' '))
    print(sum([a,b,c])-max(a,b,c))

main()
Buggy code:
S = input().split()  

A = int(S[0])
B = int(S[1])
C = int(S[2])
answer_1 = A + B
answer_2 = A + C
answer_3 = B + C

print(max(answer_1,answer_2,answer_3))


Fixed code:
S = input().split()  

A = int(S[0])
B = int(S[1])
C = int(S[2])
answer_1 = A + B
answer_2 = A + C
answer_3 = B + C

print(min(answer_1,answer_2,answer_3))
Buggy code:
list = list(map(int, input().split()))
print(list)
list.sort()
print(list[0]+list[1])


Fixed code:
i = list(map(int, input().split()))
i.sort()
print(i[0]+i[1])