Buggy python submission (verdict: Runtime Error):
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
pq={}
for i in range(n):
    x,y=xy[i]
    for j in range(n):
        if j==i:continue
        xx,yy=xy[j]
        p=xx-x
        q=yy-y
        pq.setdefault((p,q),0)
        pq[(p,q)]+=1
print(n-max(pq.values()))


Fixed submission:
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
if n==1:
    print(1)
    exit()
pq={}
for i in range(n):
    x,y=xy[i]
    for j in range(n):
        if j==i:continue
        xx,yy=xy[j]
        p=xx-x
        q=yy-y
        pq.setdefault((p,q),0)
        pq[(p,q)]+=1
print(n-max(pq.values()))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

def cost(i,p=100,q=100,s=1,used=set()):
    if len(used)==n:
        return s
    if not used:
        used.add(i)
        x0,y0=xy[i]
        re=[]
        for j in range(n):
            if j==i:continue
            x,y=xy[j]
            used.add(j)
            re+=[cost(j,x-x0,y-y0,1,used)]
            used.remove(j)
        return min(re)
    x0,y0=xy[i]
    re=[]
    for j in range(n):
        if j in used:continue
        x,y=xy[j]
        used.add(j)
        if (x-x0,y-y0)==(p,q):
            re+=[cost(j,p,q,s,used)]
        else:
            re += [cost(j,p,q,s+1,used)]
        used.remove(j)
    return min(re)

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
mn=100
for i in range(n):
    c=cost(i)
    if c<mn:
        mn=c
print(mn)

Fixed submission:
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
if n==1:
    print(1)
    exit()
pq={}
for i in range(n):
    x,y=xy[i]
    for j in range(n):
        if j==i:continue
        xx,yy=xy[j]
        p=xx-x
        q=yy-y
        pq.setdefault((p,q),0)
        pq[(p,q)]+=1
print(n-max(pq.values()))

Buggy python submission (verdict: Runtime Error):
def cost(i,p=100,q=100,s=1,used=set()):
    if len(used)==n:
        return s
    if not used:
        used.add(i)
        x0,y0=xy[i]
        re=[]
        for j in range(n):
            if j==i:continue
            x,y=xy[j]
            used.add(j)
            re+=[cost(j,x-x0,y-y0,1,used)]
            used.remove(j)
        return min(re)
    x0,y0=xy[i]
    re=[]
    for j in range(n):
        if j in used:continue
        x,y=xy[j]
        used.add(j)
        if (x-x0,y-y0)==(p,q):
            re+=[cost(j,p,q,s,used)]
        else:
            re += [cost(j,p,q,s+1,used)]
        used.remove(j)
    return min(re)

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
mn=100
for i in range(n):
    c=cost(i)
    if c<mn:
        mn=c
print(mn)

Fixed submission:
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
if n==1:
    print(1)
    exit()
pq={}
for i in range(n):
    x,y=xy[i]
    for j in range(n):
        if j==i:continue
        xx,yy=xy[j]
        p=xx-x
        q=yy-y
        pq.setdefault((p,q),0)
        pq[(p,q)]+=1
print(n-max(pq.values()))

Buggy python submission (verdict: Runtime Error):
def cost(i,p=100,q=100,s=1,used=set()):
    if len(used)==n:
        return s
    if not used:
        used.add(i)
        x0,y0=xy[i]
        re=[]
        for j in range(n):
            if j==i:continue
            x,y=xy[j]
            used.add(j)
            re+=[cost(j,x-x0,y-y0,1,used)]
            used.remove(j)
        return min(re)
    x0,y0=xy[i]
    re=[]
    for j in range(n):
        if j in used:continue
        x,y=xy[j]
        used.add(j)
        if (x-x0,y-y0)==(p,q):
            re+=[cost(j,p,q,s,used)]
        else:
            re += [cost(j,p,q,s+1,used)]
        used.remove(j)
    return min(re)

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
mn=100
for i in range(n):
    c=cost(i)
    if c<mn:
        mn=c
print(mn)

Fixed submission:
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
if n==1:
    print(1)
    exit()
pq={}
for i in range(n):
    x,y=xy[i]
    for j in range(n):
        if j==i:continue
        xx,yy=xy[j]
        p=xx-x
        q=yy-y
        pq.setdefault((p,q),0)
        pq[(p,q)]+=1
print(n-max(pq.values()))