Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import itertools

def solve(N: int, x: "List[int]", y: "List[int]"):
    if N == 1:
        print(1)
        return

    PL = list(zip(x,y))

    mincost = float('inf')
    for seq in itertools.permutations(PL):
        cost = 1
        p = seq[1][0] - seq[0][0]
        q = seq[1][1] - seq[0][1]
        #print(seq)
        for i in range(1,len(seq)):
            p2 = seq[i][0] - seq[i-1][0] 
            q2 = seq[i][1] - seq[i-1][1] 
            #print(p,p2,q,q2)
            if p != p2 or  q != q2:
                cost += 1
            if cost >= mincost:
                break
        mincost = min(mincost,cost)

    print(mincost)
            


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import itertools
import operator
import collections

def solve(N: int, x: "List[int]", y: "List[int]"):
    if N == 1:
        print(1)
        return

    PL = list(zip(x,y))
    PL.sort(key = operator.itemgetter(0,1))

    pqdic = collections.defaultdict(list)
    for i in range(N-1):
        for j in range(i+1,N):
            p = PL[j][0] - PL[i][0]
            q = PL[j][1] - PL[i][1]
            pqdic[p,q].append((i,j))

    max_pqlen = 0
    for k,v in pqdic.items():
        max_pqlen = max(max_pqlen,len(v))

    print(N - max_pqlen)




# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import itertools

def solve(N: int, x: "List[int]", y: "List[int]"):
    PL = list(zip(x,y))

    mincost = float('inf')
    for seq in itertools.permutations(PL):
        cost = 1
        p = seq[1][0] - seq[0][0]
        q = seq[1][1] - seq[0][1]
        #print(seq)
        for i in range(1,len(seq)):
            p2 = seq[i][0] - seq[i-1][0] 
            q2 = seq[i][1] - seq[i-1][1] 
            #print(p,p2,q,q2)
            if p != p2 or  q != q2:
                cost += 1
        mincost = min(mincost,cost)

    print(mincost)
            


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import itertools
import operator
import collections

def solve(N: int, x: "List[int]", y: "List[int]"):
    if N == 1:
        print(1)
        return

    PL = list(zip(x,y))
    PL.sort(key = operator.itemgetter(0,1))

    pqdic = collections.defaultdict(list)
    for i in range(N-1):
        for j in range(i+1,N):
            p = PL[j][0] - PL[i][0]
            q = PL[j][1] - PL[i][1]
            pqdic[p,q].append((i,j))

    max_pqlen = 0
    for k,v in pqdic.items():
        max_pqlen = max(max_pqlen,len(v))

    print(N - max_pqlen)




# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()