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

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  6 16:28:37 2019

@author: iwata
"""

A,B,K = map(int,input().split())
count = 0

if A >= B:
    for i in reversed(range(B+1)):
        rema1 = A%i
        remb1 = B%i
        if rema1==0 and remb1==0:
            count = count +1
        if K == count:
            print(i)
            break
else:
    for j in reversed(range(A+1)):
        rema = A%j
        remb = B%j
        if rema==0 and remb==0:
            count = count +1
        if K == count:
            print(j)
            break

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  6 16:28:37 2019

@author: iwata
"""

A,B,K = map(int,input().split())
count = 0

if A >= B:
    for i in reversed(range(B)):
        rema1 = A%i
        remb1 = B%i
        if rema1==0 & remb1==0:
            count = count +1
        if K == count:
            print(i)
            break
else:
    for j in reversed(range(A)):
        rema = A%j
        remb = B%j
        if rema==0 & remb==0:
            count = count +1
        if K == count:
            print(j)
            break
Problem p03126 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 21:09:45 2019

@author: iwata
"""

N, M = map(int, input().split())
anew = []         

a = list(map(int, input().split()))
for i in range(1,len(a)):
    anew.append(a[i])

if N==1:
    print(len(anew))
else:
    for j in range(1,N):
        a = list(map(int, input().split()))
        for k in range(1, len(a)):
            anew.append(a[k])
        anew_duplicate = [x for x in set(anew) if anew.count(x) > 1]
        anew = anew_duplicate 
    print(len(anew_duplicate))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 21:09:45 2019

@author: iwata
"""

N, M = map(int, input().split())
anew = []         

a = list(map(int, input().split()))
for i in range(1,len(a)):
    anew.append(a[i])

for j in range(1,N):
    a = list(map(int, input().split()))
    for k in range(1, len(a)):
        anew.append(a[k])
    anew_duplicate = [x for x in set(anew) if anew.count(x) > 1]
    anew = anew_duplicate 
print(len(anew_duplicate))
Problem p03206 (python)

Fixed submission:
D = input()
if D=="25":
    print("Christmas")
elif D =="24":
    print("Christmas Eve")
elif D =="23":
    print("Christmas Eve Eve")
elif D == "22":
    print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D = input()
if D=="25":
    print("Christmas")
elif D =="24":
    print("Christmas Eve")
elif D =="23":
    print("Christmas Eve Eve")
elif D == "22"
    print("Christmas Eve Eve Eve")
Problem p03210 (python)

Fixed submission:
x = input()
if x == "7"or x=="5"or x=="3":
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
x = input()
if x == "7"or"5"or"3"
    print("YES")
else:
    print("NO")
Problem p03369 (python)

Fixed submission:

S = input()
num = 700


for i in S:
    if i == "o":
        num += 100
print(num)

Buggy submission (verdict: Runtime Error):

S = list(input())
num = 700


for i in S:
    if i == "o"
        num += 100
print(num)
Problem p03377 (python)

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

if A <= X <= A+B:
    print("YES")
else:
    print("NO")

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

if A <= X <= A+B:
    print("YES")
else:
    print("No")
Problem p03385 (python)

Fixed submission:
S = input()

if "a" in S and "b" in S and "c" in S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

S = input()

A = set["a","b","c"]

if set(S) == A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = list(input())

A = set["a","b","c"]

if set(S) == A:
    print("Yes")
else:
    print("No")
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):
a, b, c = map(int, input().split())

if a+b >= c
    print("Yes")
else:
    print("No")

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

if a+b >= c
    print("Yes")
else:
    print("No")
Problem p03415 (python)

Fixed submission:
c1 = input()
c2 = input()
c3 = input()

print(c1[0]+c2[1]+c3[2])

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

if a+b >= c
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
S = list(input())
S[3] = "8"
print("".join(S))

Buggy submission (verdict: Runtime Error):
S = input()
Snew = "2018"
for i in range(4):
    S[i] = Snew[i] 
    
print(S)

Buggy submission (verdict: Runtime Error):

S = input()
S[0:3]="2018"
print(S)

Buggy submission (verdict: Runtime Error):

S = input()
S[0:3]="2017"
print(S)
Problem p03547 (python)

Fixed submission:
X, Y = input().split()

if X>Y:
    print(">")
elif X==Y:
	print("=")
else:
    print("<")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
X1 = int(X, 16)
X2 = int(Y, 16)

if X>Y:
    print(">")
elif X==Y:
	print("=")
else:
    print("<")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
X1 = int(X, 16)
X2 = int(Y, 16)

if X>Y:
    print(">")
else:
    print("<")
Problem p03563 (python)

Fixed submission:


R = int(input())
G = int(input())

print(2*G-R)

Buggy submission (verdict: Runtime Error):

R = int(input())
G = int(input())

print(2*G/R)
Problem p03605 (python)

Fixed submission:
N = input()
count = N.count("9")
if count >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
count = N.count(9)
if count >= 1:
    print("Yes")
else:
    print("No")
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):
x, a, b = map(int, input().split())

if abs(a-x) < abs(b-x):
    print(B)
else:
    print(A)
Problem p03671 (python)

Fixed submission:

list1 = list(map(int, input().split()))
list1.sort()
print(list1[0]+list1[1])

Buggy submission (verdict: Runtime Error):

list1 = list(map(int, input().split()))
list1.sort()
print(list[0]+list[1])
Problem p03737 (python)

Fixed submission:
s1, s2, s3 = input().split()

print(str.upper(s1[0]+s2[0]+s3[0]))

Buggy submission (verdict: Runtime Error):


s1, s2, s3 = input().split())

print(str.upper(s1[0]+" "+s2[0]+" "+s3[0]))

Buggy submission (verdict: Runtime Error):


s1, s2, s3 = map(int, input().split())

print(str.upper(s1[0]+" "+s2[0]+" "+s3[0]))

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = map(int, input().split())

str.upper(s1[0]+" "+s2[1]+" "+s3[2])
Problem p03773 (python)

Fixed submission:
A, B = map(int, input().split())
 
if A+B>=24:
    print(A+B-24)
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
 
if A+B>=24:
    print(A+B-24)
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):

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

if A+B=>24:
    print(A+B-24)
else:
    print(A+B)
Problem p03777 (python)

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

if (a=="H"and b=="H")or(a=="D" and b=="D"):
    print("H")
else:
    print("D")

Buggy submission (verdict: Runtime Error):
a, b = input.split()

if (a=="H"and b=="H")or(a=="D" and b=="D"):
    print("H")
else:
    print("D")
Problem p03844 (python)

Fixed submission:
A,op,B = input().split()
A = int(A)
B = int(B)
if op=="+":
    print(A+B)
else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B = input().split
A = int(A)
B = int(B)
if op=="+":
    print(A+B)
else:
    print(A-B)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())  

print(int((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())  

print(int((a+b)*h/2)
Problem p02988 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
arr = [int(i) for i in input().split(" ")]
l = len(arr)
count = 0
for i in range(0, l-2):
    m = arr[i+1]
    tmp = [arr[i], arr[i+1], arr[i+2]]
    tmp.sort()
    if m == tmp[1]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
arr = [int(i) for i in input().split(" ")]
l = len(arr)
count = 1
for i in range(0, l-3):
    if arr[i] < arr[i+1] and arr[i*1] < arr[i*2]:
        count += 1
    elif arr[i+2] < arr[i+1] and arr[i*1] < arr[i2]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
arr = [int(i) for i in input().split(" ")]
l = len(arr)
count = 1
for i in range(0, l-3):
    if arr[i] < arr[i+1] and arr[i*1] < arr[i*2]:
        count += 1

print(count)
Problem p03494 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
counter = 0
arr = [int(i) for i in input().split(" ")]
flag = True
while flag:
    ret = []
    for i in range(len(arr)):
        if arr[i] % 2 == 1:
            flag = False
            break
        arr[i] = arr[i] >> 1
        if arr[i] % 2 == 1:
            counter = counter + 1
            flag = False
            break
    if flag:
        counter = counter + 1

print(counter)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
counter = 0
arr = [int(i) for i in input().split(" ")]
flag = True
while 0 < len(arr):
    counter = counter + 1
    for i in arr:
        arr[i] = arr[i] << 1
        if arr[i] == 1:
            pass
        else:
            ret.append(arr[i])
    arr = ret

print(counter)
Problem p03478 (python)

Fixed submission:
n, b, c = map(int, input().split())
ans = 0
for i in range(n + 1):
    if b <= sum(list(map(int, list(str(i))))) <= c:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n, b, c = map(int, input().split(""))
ans = 0
for i in range(n + 1):
    if b <= sum(list(map(int, list(str(i))))) <= c:
        ans += i
print(ans)
Problem p03486 (python)

Fixed submission:
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
print("Yes") if s < t else print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort()

r = len(s) if len(s) < len(t) else len(t)
for i in range(0, r):
    if (not s or not t):
        break
    if s.pop(i) == t.pop(i):
        continue
    elif s.pop(i) < t.pop(i):
        print("Yes")
        exit()
    else:
        print("No")
        exit()
print("Yes") if len(s) < len(t) else print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort()

r = len(s) if len(s) < len(t) else len(t)
for i in range(0, r):
    if s.pop(i) == t.pop(i):
        continue
    elif s.pop(i) < t.pop(i):
        print("Yes")
        exit()
    else:
        print("No")
        exit()
print("Yes") if len(s) < len(t) else print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort()

r = len(s) if len(s) < len(t) else len(t)
for i in range(0, r-1):
    if s.pop(i) == t.pop(i):
        continue
    elif s.pop(i) < t.pop(i):
        print("Yes")
        exit()
    else:
        print("No")
        exit()
print("Yes") if len(s) < len(t) else print("No")
Problem p03434 (python)

Fixed submission:
N = int(input())
card_num = list(map(int, input().split()) )
card_num.sort(reverse=True)

alice = 0
bob = 0

for i in range(0,N):
  if i %2 == 0:
    alice += card_num[i]
  else:
    bob   += card_num[i] 
ans = int(alice - bob)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
card_num = list(map(int, input().split()) )
card_num.sort(reverse=True)

alice = 0
bob = 0

for i in range(0,N):
  if i %2 == 0:
    alice += card_num[i]
  else:
    bob   += card_num[i+1] 
ans = int(alice - bob)

print(ans)
Problem p03026 (python)

Fixed submission:
import sys

sys.setrecursionlimit(100000)

n = int(input())
edgeList0 = [list(map(int, input().split())) for i in range(n-1)]
cList = list(map(int,input().split()))
cList.sort(reverse=True)
print(sum(cList[1:]))
edgeList = []
for _ in range(n):
  edgeList.append([])
for i in edgeList0:
  edgeList[i[0]-1].append(i[1]-1)
  edgeList[i[1]-1].append(i[0]-1)

def edgefunc(j):
  numList.append((j,cList.pop(0)))
  if len(edgeList[j]) != 0:
    for k in edgeList[j]:
      edgeList[k].remove(j)
      edgefunc(k)

numList = []
edgefunc(0)
numList.sort()
answer2 = ""
for l in numList:
  answer2 += str(l[1]) + " "
print(answer2[:-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
edgeList0 = [list(map(int, input().split())) for i in range(n-1)]
cList = list(map(int,input().split()))
cList.sort(reverse=True)
print(sum(cList[1:]))
edgeList = []
for _ in range(n):
  edgeList.append([])
for i in edgeList0:
  edgeList[i[0]-1].append(i[1]-1)
  edgeList[i[1]-1].append(i[0]-1)

def edgefunc(j):
  numList.append((j,cList.pop(0)))
  if len(edgeList[j]) != 0:
    for k in edgeList[j]:
      edgeList[k].remove(j)
      edgefunc(k)

numList = []
edgefunc(0)
numList.sort()
answer2 = ""
for l in numList:
  answer2 += str(l[1]) + " "
print(answer2[:-1])
Problem p03059 (python)

Fixed submission:
a, b, t = map(int,input().split())
print(t // a * b)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(gcd(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-1])
  maxList.append(lValueList[n-1])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-2-k])
    maxList.append(g)
    
  print(max(maxList))
Problem p03061 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(max(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-1-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
  for k in range(n-2):
    g = gcd(fValueList[k], lValueList[n-3-k])
    maxList.append(g)
    
  print(max(maxList))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import copy

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

fValueList = []
lValueList = []
maxList = []

if n == 2:
  print(gcd(a[0], a[1]))
else:
  fValueList.append(a[0])
  lValueList.append(a[n-1])
  for i in range(1,n-1):
    g = fValueList[i-1]
    fValueList.append(gcd(g, a[i]))

  for i in range(1,n-1):
    g = lValueList[i-1]
    lValueList.append(gcd(g, a[n-i]))
  
  maxList.append(fValueList[n-2])
  maxList.append(lValueList[n-2])
for k in range(n-2):
    g = gcd(lValueList[k], lValueList[n-3-k])
  maxList.append(g)
    
print(max(maxList))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import copy

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

valueList = [a[0]]
maxList = []

g = a[0]
valueList.append(g)
g = a[1]
for k in range(i+1, n):
  g = gcd(g, a[k])
maxList.append(g)
  

for i in range(1,n):
  g = a[0]
  for j in range(i):
    g = gcd(g,a[j])
  valueList.append(g)
  g = valueList[i]
  for k in range(i+1, n):
    g = gcd(g, a[k])
  maxList.append(g)
    
print(max(maxList))
Problem p04001 (python)

Fixed submission:
s = input()
answer = 0
sumList = []
numStr = ""
if len(s) == 1:
  print(s)
else:
  for i in range(2**(len(s)-1)):
    bit = "0" + str(len(s) - 1) + "b"
    iStr = format(i, bit)
    numStr += s[0]
    for j in range(len(iStr)):
      if iStr[j] == "1":
        sumList.append(int(numStr))
        numStr = s[j+1]
      else:
        numStr += s[j+1]
    sumList.append(int(numStr))
    numStr = ""
    answer += sum(sumList)
    sumList = []
  print(answer)

Buggy submission (verdict: Runtime Error):
s = input()
answer = 0
sumList = []
numStr = ""
for i in range(2**(len(s)-1)):
  bit = "0" + str(len(s) - 1) + "b"
  iStr = format(i, bit)
  numStr += s[0]
  for j in range(len(iStr)):
    if iStr[j] == "1":
      sumList.append(int(numStr))
      numStr = s[j+1]
    else:
      numStr += s[j+1]
  sumList.append(int(numStr))
  numStr = ""
  answer += sum(sumList)
  sumList = []
print(answer)
Problem p02993 (python)

Fixed submission:
import sys
S = input()

for i in range(3):
  if S[i] == S[i+1]:
    print("Bad")
    sys.exit()
print("Good")

Buggy submission (verdict: Runtime Error):
import sys
S = int(input())

for i in range(3):
  if S[i] == S[i+1]:
    print("Bad")
    sys.exit()
print("Good")
Problem p03487 (python)

Fixed submission:
#!/usr/bin/env python

N=int(input())
a=[int(i) for i in input().split()] 
a.sort()
numbers=[int(i) for i in set(a)]
numbers.sort()

# dictの初期化
numbers_count = {}
# for i in numbers:
for i in numbers:
    numbers_count[i] = 0 

# 数値別の集計
for i in a:
    numbers_count[i] += 1

# 取り除く数を算出
remove=0
for i in numbers:
    # 3が2つある
    if(i > numbers_count[i]):
        remove += numbers_count[i]
    # 3が4つある
    elif(i < numbers_count[i]):
        remove += numbers_count[i] - i

print(remove)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

N=int(input())
a=[int(i) for i in input().split()] 

a.sort()
numbers=[int(i) for i in set(a)]
numbers.sort()

# print("a", a)
# print("numbers", numbers)

def main():
    label=0 # numbersの添字
    i=0 # aの添字
    err=0 # 削除する要素の数
    while(True):
        # 範囲を超えるパターン
        if(len(numbers) <= label or len(a) <= i):
            # print("Exit")
            return err
        # 最初が一致
        if(a[i]==numbers[label]):
            # 要素数分を確保
            ar=[ numbers[label] ] * numbers[label]
            # ピッタリ一致
            if(a[ i:i+numbers[label] ] == ar):
                # print("[ fit ] i="+str(i))
                # print("a["+str(i)+"]="+str(a[i]))
                i += numbers[label]
                label += 1
            # 最初が一致かつ不完全一致
            else:
                # print("[unfit] i="+str(i))
                for j in range(0, i):
                    try:
                        # 値が不一致(要素)
                        # print("a[i+j]="+str(a[i+j]))
                        # print("numbers[label]="+str(numbers[label]))
                        if(a[i+j]!=numbers[label]):
                            # print("Unmatched: j=", j)
                            i+=j
                            err+=j
                            break
                    except IndexError:
                        err+=j
                        # print("i, j=", i, j)
                        return err
        # 最初が不一致(右に1つずらす)
        else:
            err+=1
            i+=1

if(N==1):
    if(a[0]==1):
        print(0)
    else:
        print(1)
else:
    print(main())
Problem p03555 (python)

Fixed submission:
#!/usr/bin/env python

# input
str1=input()
str2=input()

if str1 == str2[::-1]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
 
# input
str1=input()
str2=input()
 
if str1 == str2[::-1]:
    print("YES")
else:
    print("NO")
Problem p03006 (python)

Fixed submission:
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N = ri()
XY = []
for i in range(N):
    x,y=rl()
    XY.append((x,y))
XY.sort()
XYD = []
for i in range(N):
    x,y = XY[i]
    ret = []
    for j in range(i+1,N):
        ret.append((XY[j][0] - x, XY[j][1] - y))
    XYD.extend(ret)

import collections
c = collections.Counter(XYD).most_common()
if N == 1:
    print(1)
else:
    print(N-c[0][1])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N = ri()
XY = []
for i in range(N):
    x,y=rl()
    XY.append((x,y))
XY.sort()
XYD = []
for i in range(N):
    x,y = XY[i]
    ret = []
    for j in range(i+1,N):
        ret.append((XY[j][0] - x, XY[j][1] - y))
    XYD.extend(ret)

import collections
c = collections.Counter(XYD).most_common()
print(N-c[0][1])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N = ri()
XY = []
for i in range(N):
    x,y=rl()
    XY.append((x,y))
XY.sort()
XYD = []
for i in range(N):
    x,y = XY[i]
    ret = []
    for j in range(i+1,N):
        ret.append((XY[j][0] - x, XY[j][1] - y))
    XYD.extend(ret)

import collections
c = collections.Counter(XYD).most_common()
print(N-c[0][1])
Problem p03062 (python)

Fixed submission:
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N=ri()
A=list(rl())
cnt = [0]*3
ans = 0
sei = []
for a in A:
    sei.append(abs(a))
    ans += abs(a)
    if a > 0:
        cnt[0] += 1
    elif a == 0:
        cnt[1] += 1
    elif a < 0:
        cnt[2] += 1

if cnt[1] > 0 or cnt[2]%2 == 0:
    None
else:
    ans -= 2 * min(sei)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N=ri()
A=list(rl())
cnt = [0]*3
ans = 0
sei = []
for a in A:
    ans += abs(a)
    if a > 0:
        sei.append(a)
        cnt[0] += 1
    elif a == 0:
        cnt[1] += 1
    elif a < 0:
        cnt[2] += 1

if cnt[1] > 0 or cnt[2]%2 == 0:
    None
else:
    ans -= 2 * min(sei)

print(ans)