Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
nm = list(map(int, input().split()))
lis = list(map(int, input().split()))

lis.sort()

sum = 0
diff = []

if nm[1] - nm[0] <= 0:
    print(0)
else:
    for i in range (nm[1] - 1):
        diff[i] = lis[i + 1] - lis[i]

    diff.sort()

    for j in range (nm[0] - 1):
        diff.pop(-1)

    for k in range (nm[1] - nm [0] - 1):
        sum = sum + diff[k]
    
    print(sum)

Fixed submission:
nm = list(map(int, input().split()))
lis = list(map(int, input().split()))

lis.sort()

sum = 0
diff = []

if nm[1] - nm[0] <= 0:
    print(0)
else:
    for i in range (nm[1] - 1):
        diff.append(lis[i + 1] - lis[i])

    diff.sort()

    if nm[0] != 1:
        for j in range (nm[0] - 2):
            diff.pop(-1)

    for k in range (nm[1] - nm [0]):
        sum = sum + diff[k]

    print(sum)

Buggy python submission (verdict: Runtime Error):
import numpy as np

nm = list(map(int, input().split()))
lis = list(map(int, input().split()))

lis.sort()

diff = []

for i in range (nm[1] - 1):
    diff[i] = lis[i + 1] - lis[i]

diff.sort()

for j in range (nm[0] - 1):
    diff.pop(-1)

print(np.sum(diff))

Fixed submission:
nm = list(map(int, input().split()))
lis = list(map(int, input().split()))

lis.sort()

sum = 0
diff = []

if nm[1] - nm[0] <= 0:
    print(0)
else:
    for i in range (nm[1] - 1):
        diff.append(lis[i + 1] - lis[i])

    diff.sort()

    if nm[0] != 1:
        for j in range (nm[0] - 2):
            diff.pop(-1)

    for k in range (nm[1] - nm [0]):
        sum = sum + diff[k]

    print(sum)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
MA = [list(input().strip()) for _ in range(H)]
VI = [[-1] * W for _ in range(H)]

kabe = 0
for i in range(H):
    kabe += MA[i].count("#")

from collections import deque


def bfs(ma, vi):
    Q = deque([(0,0)])
    sy, sx = (0,0)
    vi[sy][sx] = 0
    while True:
        q = Q.popleft()
        y, x = q
        if q == (H-1,W-1):
            return vi[y][x]
        for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)):
            nq = y + dy, x + dx
            ny, nx = nq
            if 0 <= ny < H and 0 <= nx < W and vi[ny][nx] == -1:
                if ma[ny][nx] == '.':
                    Q.append(nq)
                    vi[ny][nx] = vi[y][x] + 1



print(H * W - kabe - bfs(MA, VI) - 1)

Fixed submission:
H, W = map(int, input().split())
MA = [list(input().strip()) for _ in range(H)]
VI = [[-1] * W for _ in range(H)]

kabe = 0
for i in range(H):
    kabe += MA[i].count("#")

from collections import deque


def bfs(ma, vi):
    Q = deque([(0,0)])
    sy, sx = (0,0)
    vi[sy][sx] = 0
    while True:
        if Q == deque([]):
            return -1
        q = Q.popleft()
        y, x = q
        if q == (H-1,W-1):
            return vi[y][x]
        for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)):
            nq = y + dy, x + dx
            ny, nx = nq
            if 0 <= ny < H and 0 <= nx < W and vi[ny][nx] == -1:
                if ma[ny][nx] == '.':
                    Q.append(nq)
                    vi[ny][nx] = vi[y][x] + 1


score = bfs(MA,VI)

if score != -1:
    print(H * W - kabe - score - 1)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations

N, M, R = map(int,input().split())
r = [i - 1 for i in map(int,input().split())]

d = [[float('inf')] * N for _ in range(N)]

for i in range(N):
    d[i][i] = 0

for i in range(M):
    a, b, c = map(int,input().split())
    d[a - 1][b - 1] = c
    d[b - 1][a - 1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]

ans = 10 ** 12

for each in permutations(r):
    t_dis = 0
    for i in range(R - 1):
        t_dis += d[each[i]][each[i + 1]]

    ans = min(ans, t_dis)

print(ans)


Fixed submission:
from itertools import permutations

N, M, R = map(int,input().split())
r = [i - 1 for i in map(int,input().split())]

d = [[float('inf')] * N for _ in range(N)]

for i in range(N):
    d[i][i] = 0

for i in range(M):
    a, b, c = map(int,input().split())
    d[a - 1][b - 1] = c
    d[b - 1][a - 1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]

ans = 10 ** 12

for each in permutations(r):
    t_dis = 0
    for i in range(R - 1):
        t_dis += d[each[i]][each[i + 1]]

    ans = min(ans, t_dis)

print(ans)
Buggy python submission (verdict: Runtime Error):
S = list(input())
S.append("A")
for i in range(26):
    if S.count(chr(97 + i)) >= 2:
        for j in range(len(S) - 1):
            if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)):
                print((j+1), (j+2))
                exit()
            if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)):
                print((j+1), (j+3))
                exit()
else:
    print("-1 -1")


Fixed submission:
S = list(input())
S.append("A")
for j in range(len(S) - 2):
    if (S[j] == S[j + 1]):
        print(j+1, j+2)
        exit()
    if (S[j] == S[j + 2]):
        print(j+1, j+3)
        exit()
else:
    print("-1 -1")

Buggy python submission (verdict: Runtime Error):
S = list(input())
S.append("A")
for i in range(26):
    if S.count(chr(97 + i)) >= 2:
        for j in range(len(S) - 1):
            if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)):
                print(j+1, j+2)
                exit()
            if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)):
                print(j+1, j+3)
                exit()
else:
    print("-1 -1")


Fixed submission:
S = list(input())
S.append("A")
for j in range(len(S) - 2):
    if (S[j] == S[j + 1]):
        print(j+1, j+2)
        exit()
    if (S[j] == S[j + 2]):
        print(j+1, j+3)
        exit()
else:
    print("-1 -1")

Buggy python submission (verdict: Runtime Error):
S = list(input())
S.append(1)
for i in range(26):
    if S.count(chr(97 + i)) >= 2:
        for j in range(len(S) - 1):
            if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)):
                print(j+1, j+2)
                exit()
            if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)):
                print(j+1, j+3)
                exit()
else:
    print("-1 -1")


Fixed submission:
S = list(input())
S.append("A")
for j in range(len(S) - 2):
    if (S[j] == S[j + 1]):
        print(j+1, j+2)
        exit()
    if (S[j] == S[j + 2]):
        print(j+1, j+3)
        exit()
else:
    print("-1 -1")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split(' '))
if B % A == 0:
    print(A + B)
 else:
    print(B - A)

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

if B % A == 0:
    print(A + B)
else:
    print(B - A)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
a_list2 = sorted([a - (i + 1) for i, a in enumerate(a_list)])

s = 0
b = math.floor(sum(a_list2) / n)

for a in a_list2:
    s += abs(a - b)
    
print(s)

Fixed submission:
import math
import numpy as np

n = int(input())
a_list = list(map(int, input().split()))
a_list2 = sorted([a - (i + 1) for i, a in enumerate(a_list)])

s_cand = []
b_cand = [math.floor(sum(a_list2) / n), math.ceil(sum(a_list2) / n), int(np.median(a_list2))]

for b in b_cand:
    s = 0
    for a in a_list2:
        s += int(abs(a - b))
    s_cand.append(s)
    
print(min(s_cand))
Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split(' '))

i = min(X, Y)
cond = False
if X != Y:
    while i <= 1000000000:
        if (i % X) == 0:
            if (i % Y) != 0:
                cond = True
                break
        i += 1

if cond:
    print(i)
else:
    print(-1)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

if X < Y:
    print(X)
elif X % Y == 0:
    print(-1)
elif gcd(X, Y) == 1:
    print(X)
else:
    tmp = X * gcd(X, Y)
    if tmp % Y != 0:
        print(tmp)
    else:
        print(X * int(X / gcd(X, Y)))

Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split(' '))

i = 1
cond = False
if X != Y:
    while i <= 1000000000:
        if (i % X) == 0:
            if (i % Y) != 0:
                cond = True
                break
        i += 1

if cond:
    print(i)
else:
    print(-1)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

if X < Y:
    print(X)
elif X % Y == 0:
    print(-1)
elif gcd(X, Y) == 1:
    print(X)
else:
    tmp = X * gcd(X, Y)
    if tmp % Y != 0:
        print(tmp)
    else:
        print(X * int(X / gcd(X, Y)))
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math

N = int(input())
low = 0
high = N - 1

print(0)
start = input()
tmp = math.ceil((high + low) / 2)
print(tmp)

while True:
    i = input()
    if i == 'Vacant':
        break
        
    else:
        if (tmp % 2 == 0 and i == start) or (tmp_seat % 2 != 0 and i != start):
            low = tmp
        else:
            high = tmp
        
        tmp = math.ceil((high + low) / 2)
        print(tmp)

sys.stdout.flush()

Fixed submission:
import sys, math

N = int(input())
genders = ['Male', 'Female']
low = 0
high = N - 1

tmp_seat = low
print(tmp_seat)

start = input()

tmp_seat = math.ceil((high + low) / 2)
print(tmp_seat)

while True:
    i = input()
    if i == 'Vacant':
        break
    else:
        if (tmp_seat % 2 == 0 and i == start) or (tmp_seat % 2 != 0 and i != start):
            low = tmp_seat   
        else:
            high = tmp_seat
        
        tmp_seat = math.ceil((high + low) / 2)
        print(tmp_seat)
            
sys.stdout.flush()
Buggy python submission (verdict: Runtime Error):
read=input();
A,B=read.spilt(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(B/2);
else:
  print(0);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):
read=input();
A,B=read.spilt(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(B/2);
else:
  print(B);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):
read=input();
A,B=read.spilt(' ')
A=int(A)
B=int(B)
if A>=0 and A<=5:
  print(0);
elif A>5 and A<=12:
  print(B/2);
else:
  print(B);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):
read=input();
A,B=map(int,read).spilt(' ')
if A>=0 and A<=5:
  print(0);
elif A>5 and A<=12:
  print(B/2);
else:
  print(B);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):
read=input;
A,B=map(int,read()).spilt()
if A>=0 and A<=5:
  print(0);
elif A>5 and A<=12:
  print(B/2);
else:
  print(B);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):

if A>=0 and A<=5:
  print(0);
elif A>5 and A<=12:
  print(B/2);
else:
  print(B);

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);

Buggy python submission (verdict: Runtime Error):

if A>=0 and A<=5:
  return 0;
elif A>5 and A<=12:
  return B/2;
else:
  return B;

Fixed submission:
read=input();
A,B=read.split(' ')
A=int(A)
B=int(B)
if A>12:
  print(B);
elif A>5:
  print(int(B/2));
else:
  print(0);
Buggy python submission (verdict: Runtime Error):
read=input
r,d,x=map(int,read()).split(' ')
for i in range(10):
  x=int(r*x-d)
  print(x)

Fixed submission:
read=input
r,d,x=map(int,read().split(' '))
for i in range(10):
  x=int(r*x-d)
  print(x)
Buggy python submission (verdict: Runtime Error):
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
mini=-1
maxi=1000000000000000
for i in range(m):
    a,b=[int(i) for i in input().split(' ')]
	tmp_mini=max(mini,a)
    tmp_maxi=min(maxi,b)
    if(tmp_mini<tmp_maxi):
      mini=tmp_mini
      maxi=tmp_maxi
    elif(tmp_mini==tmp_maxi):
      if tmp_mini<=n:
        print(1)
        break
      else:
        print(0)
        break
    else:
      print(0)
      break
if(mini<maxi):      
  if n>=maxi:
    print(maxi-mini+1)
  elif maxi>n>=mini:
    print(n-mini+1)
  else:
    print(0)

  	

Fixed submission:
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=[int(i) for i in input().split(' ')]
result=min(r)-max(l)+1
result=result if result>0 else 0
print(result)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
mini=-1
maxi=1000000000000000
for i in range(m):
    a,b=[int(i) for i in input().split(' ')]
	tmp_mini=max(mini,a)
    tmp_maxi=min(maxi,b)
    if(tmp_mini<tmp_maxi):
      mini=tmp_mini
      maxi=tmp_maxi
    elif(tmp_mini==tmp_maxi):
      if tmp_mini<=n:
        print(1)
        break
      else:
        print(0)
        break
    else:
      print(0)
      break
      
if n>=maxi:
  print(maxi-mini+1)
elif maxi>n>=mini:
  print(n-mini+1)
else:
  print(0)

  	

Fixed submission:
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=[int(i) for i in input().split(' ')]
result=min(r)-max(l)+1
result=result if result>0 else 0
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
gate=[0]*m
for i in range(m):
    a,b=[int(i) for i in input().split(' ')]
    gate[i]=set([j for j in range(a,b+1)])
result=reduce(lambda x,y:x&y, gate)
count=0
for re in result:
  if re <=n:
    count+=1
print(count)
  	

Fixed submission:
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=[int(i) for i in input().split(' ')]
result=min(r)-max(l)+1
result=result if result>0 else 0
print(result)

Buggy python submission (verdict: Runtime Error):
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
gate=[0]*m
for i in range(m):
    a,b=[int(i) for i in input().split(' ')]
    gate[i]=set([j for j in range(a,b+1)])
result=reduce(lambda x,y:x&y, gate)
count=0
for re in result:
  if re <=n:
    count+=1
print(count)
  	

Fixed submission:
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=[int(i) for i in input().split(' ')]
result=min(r)-max(l)+1
result=result if result>0 else 0
print(result)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, raw_input().split())

for i in xrange(n):
  a.append(raw_input())
a.sort()
print "".join(a)

Fixed submission:

n, l = map(int, raw_input().split())
a = []
for i in xrange(n):
  a.append(raw_input())
a.sort()
print "".join(a)

Buggy python submission (verdict: Runtime Error):
n, l = map(int, raw_input().split())

for i in xrange(n):
  a.append(raw_input())
a.sort()
print " ".join(a)

Fixed submission:

n, l = map(int, raw_input().split())
a = []
for i in xrange(n):
  a.append(raw_input())
a.sort()
print "".join(a)
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
if k == 1:
  print(0)
else:
  print(N-K)

Fixed submission:
x,y = input().split()
N = int(x)
K = int(y)
if K == 1:
  print(0)
else:
  print(N-K)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
l = stdin.readline().rstrip().split()

n = int(l[0])
k=int(l[1])

if k == 1:
    print 0;
else:
    print n-k

Fixed submission:
from sys import stdin
l = stdin.readline().rstrip().split()

n = int(l[0])
k=int(l[1])

if k == 1:
    print(0)
else:
    print(n-k)

Buggy python submission (verdict: Runtime Error):
s = input().split(",")
n = int(s[0])
k=int(s[1])

if k == 1:
    return 0;
else:
    return n-k

Fixed submission:
from sys import stdin
l = stdin.readline().rstrip().split()

n = int(l[0])
k=int(l[1])

if k == 1:
    print(0)
else:
    print(n-k)
Buggy python submission (verdict: Runtime Error):
s = int(input().replace(' ',''))
print("Yes" if int(s**0.5)**2==s) else "No")

Fixed submission:
s = int(input().replace(' ',''))
print("Yes" if int(s**0.5)**2==s else "No")

Buggy python submission (verdict: Runtime Error):
s = int(input().replace(' ','')
print("Yes" if int(s**0.5)**2==s) else "No")

Fixed submission:
s = int(input().replace(' ',''))
print("Yes" if int(s**0.5)**2==s else "No")

Buggy python submission (verdict: Runtime Error):
int(input().replace(' ','')
print("Yes" if int(s**0.5)**2==s) else "No")

Fixed submission:
s = int(input().replace(' ',''))
print("Yes" if int(s**0.5)**2==s else "No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(1)
	exit()
a = sorted(a)
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = x1 - x2
		rz2 = y1 - y2
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))


Fixed submission:
n, k = map(int, input().split())
if k == 1:
	print(0)
else:
	s1 = n - k
	print(s1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = abs(x1- x2)
		rz2 = abs(y1 - y2)
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))

Fixed submission:
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(1)
	exit()
a = sorted(a)
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = x1 - x2
		rz2 = y1 - y2
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = abs(x1- x2)
		rz2 = abs(y1 - y2)
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))

Fixed submission:
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(1)
	exit()
a = sorted(a)
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = x1 - x2
		rz2 = y1 - y2
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))

Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal
def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return n,b
 
 
def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return n,b,c
 
 
def dv():
	n, m = map(int, input().split())
	return n,m
 
 
def dva():
	n, m = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return n,m,b
 
 
def eratosthenes(n): 
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))
 
 
 
def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return n,b,m,c
 
 
def dvs():
	n = int(input())
	m = int(input())
	return n, m
 

n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = abs(x1- x2)
		rz2 = abs(y1 - y2)
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))


Fixed submission:
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(1)
	exit()
a = sorted(a)
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = x1 - x2
		rz2 = y1 - y2
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))
Buggy python submission (verdict: Runtime Error):
N,A,B,C,D = map(int,input().split())
S = input()
right = max(C,D)-1
r = min(C,D)-1

if '##' in S[A-1:C-1] or '##' in S[B-1:D-1]:
  print('No')
else:
  if C < D:
  	print('Yes')
    break
  else:
    if '...' in S[B-1:right]:
      print('Yes')
      break
    else:
      if len(S[A-1:right])<=6:
        print('Yes')
        break
      print('No')


Fixed submission:
N,A,B,C,D = map(int,input().split())
S = input()
right = max(C,D)
r = min(C,D)-1

if '##' in S[A-1:C] or '##' in S[B-1:D]:
  print('No')
else:
  if C < D:
  	print('Yes')
  else:
    if '...' in S[B-2:D+1]:
      print('Yes')
    else:
      if len(S[A-1:right])<=6:
        if S[A-1:right].count('#')==2:
          print('No')
        else:
          print('Yes')
      else:
        print('No')
Buggy python submission (verdict: Runtime Error):
def fib(n):
    n += 1
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return int(f)

N, M = map(int,input().split())

if M == 0:
    print(fib(N))
    exit()

A = [int(input()) for _ in range(M)]
L = [0] * (M+1)

ans = 1

L[0] = fib(A[0]-1) % (10**9 + 7)
L[M] = fib(N-(A[M-1]+1)) % (10**9 + 7)

for i in range(1,M):
    if A[i]-A[i-1] == 1:
        print(0)
        exit()
    L[i] = fib((A[i]-1)-(A[i-1]+1)) % (10**9 + 7)

for j in range(M+1):
    ans = (ans * L[j]) % (10**9 + 7)

print(ans)


Fixed submission:
def fib(n):
    a,b = 0,1
    for i in range(n):
        a, b = b, a+b
    return int(b)

N, M = map(int,input().split())

if M == 0:
    print(fib(N) % (10**9 + 7))
    exit()

A = [int(input()) for _ in range(M)]
L = [0] * (M+1)

ans = 1

L[0] = fib(A[0]-1) % (10**9 + 7)
L[M] = fib(N-(A[M-1]+1)) % (10**9 + 7)

for i in range(1,M):
    if A[i]-A[i-1] == 1:
        print(0)
        exit()
    L[i] = fib((A[i]-1)-(A[i-1]+1)) % (10**9 + 7)

for j in range(M+1):
    ans = (ans * L[j]) % (10**9 + 7)

print(ans)

Buggy python submission (verdict: Runtime Error):
def fib(n):
    n += 1
    if n == 0:
        return 1
    else:
        f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
        return int(f)

N, M = map(int,input().split())

if M == 0:
    print(fib(N))
    exit()

A = [int(input()) for _ in range(M)]
L = [0] * (M+1)

ans = 1

L[0] = fib(A[0]-1)
L[M] = fib(N-(A[M-1]+1))

for i in range(1,M):
    if A[i]-A[i-1] == 1:
        print(0)
        exit()
    L[i] = fib((A[i]-1)-(A[i-1]+1))

for j in range(M+1):
    ans = (ans * L[j]) % (10**9 + 7)

print(ans)


Fixed submission:
def fib(n):
    a,b = 0,1
    for i in range(n):
        a, b = b, a+b
    return int(b)

N, M = map(int,input().split())

if M == 0:
    print(fib(N) % (10**9 + 7))
    exit()

A = [int(input()) for _ in range(M)]
L = [0] * (M+1)

ans = 1

L[0] = fib(A[0]-1) % (10**9 + 7)
L[M] = fib(N-(A[M-1]+1)) % (10**9 + 7)

for i in range(1,M):
    if A[i]-A[i-1] == 1:
        print(0)
        exit()
    L[i] = fib((A[i]-1)-(A[i-1]+1)) % (10**9 + 7)

for j in range(M+1):
    ans = (ans * L[j]) % (10**9 + 7)

print(ans)