Buggy python submission (verdict: Runtime Error):
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy python submission (verdict: Time Limit Exceeded):
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N

for k, ke in enumerate(S):
    for i, ie in enumerate(S):
        if k == i:
            continue
        t_vec_x1 = ie[0] - ke[0]
        t_vec_y1 = ie[1] - ke[1]
        edge = 0
        for l,le in enumerate(S):
            for m, me in enumerate(S):
                if l == m:
                    continue
                vec_x = me[0] - le[0]
                vec_y = me[1] - le[1]
                if t_vec_x1 == vec_x and t_vec_y1 == vec_y:
                    edge += 1
        cost = min(cost, N - edge)
        # t_vec_x2 = S[k][0] - S[i][0]
        # t_vec_y2 = S[k][1] - S[i][1]
        # edge = 0
        # for l in range(sl):
        #     for m in range(sl):
        #         if l == m:
        #             continue
        #         vec_x = S[l][0] - S[m][0]
        #         vec_y = S[l][1] - S[m][1]
        #         if t_vec_x2 == vec_x and t_vec_y2 == vec_y:
        #             edge += 1
        # print(edge)
        cost = min(cost, N - edge)

print(cost)


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy python submission (verdict: Time Limit Exceeded):
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N

for k in range(len(S)):
    for i in range(len(S)):
        if k == i:
            continue
        t_vec_x1 = S[i][0] - S[k][0]
        t_vec_y1 = S[i][1] - S[k][1]
        edge = 0
        for l in range(len(S)):
            for m in range(len(S)):
                if l == m:
                    continue
                vec_x = S[m][0] - S[l][0]
                vec_y = S[m][1] - S[l][1]
                if t_vec_x1 == vec_x and t_vec_y1 == vec_y:
                    edge += 1
        cost = min(cost, N - edge)
        # t_vec_x2 = S[k][0] - S[i][0]
        # t_vec_y2 = S[k][1] - S[i][1]
        # edge = 0
        # for l in range(len(S)):
        #     for m in range(len(S)):
        #         if l == m:
        #             continue
        #         vec_x = S[l][0] - S[m][0]
        #         vec_y = S[l][1] - S[m][1]
        #         if t_vec_x2 == vec_x and t_vec_y2 == vec_y:
        #             edge += 1
        # print(edge)
        cost = min(cost, N - edge)

print(cost)


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy python submission (verdict: Time Limit Exceeded):
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N

for k in range(len(S)):
    for i in range(len(S)):
        if k == i:
            continue
        t_vec_x1 = S[i][0] - S[k][0]
        t_vec_y1 = S[i][1] - S[k][1]
        edge = 0
        for l in range(len(S)):
            for m in range(len(S)):
                if l == m:
                    continue
                vec_x = S[m][0] - S[l][0]
                vec_y = S[m][1] - S[l][1]
                if t_vec_x1 == vec_x and t_vec_y1 == vec_y:
                    edge += 1
        cost = min(cost, N - edge)
        t_vec_x2 = S[k][0] - S[i][0]
        t_vec_y2 = S[k][1] - S[i][1]
        edge = 0
        for l in range(len(S)):
            for m in range(len(S)):
                if l == m:
                    continue
                vec_x = S[l][0] - S[m][0]
                vec_y = S[l][1] - S[m][1]
                if t_vec_x2 == vec_x and t_vec_y2 == vec_y:
                    edge += 1
        # print(edge)
        cost = min(cost, N - edge)

print(cost)


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append(x + y)
S.sort()
cost = N
target = 1
# 同じではなくて割り切れるやつを探す
for a in S:
    temp_cost = 1
    bb = -1
    for b in S:
        if bb != b and b % a != 0:
            # print("a:{0}, b:{1}".format(a, b))
            temp_cost += 1
        bb = b
    temp_cost += S.count(a) - 1
    if temp_cost < cost:
        cost = temp_cost
print(cost)


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append(x + y)
S.sort()
cost = N
target = 1
# 同じではなくて割り切れるやつを探す
for a in S:
    temp_cost = 1
    bb = -1
    for b in S:
        if bb != b and b % a != 0:
            # print("a:{0}, b:{1}".format(a, b))
            temp_cost += 1
        bb = b
    temp_cost += S.count(a) - 1
    if temp_cost < cost:
        print(temp_cost)
        cost = temp_cost
print(cost)


Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))