Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
count = 0
li = []
 
for i in range(1, n):
  if n - i == i or i in li:
    continue
    
  else:
    count += 1
    li.append(i)
    li.append(n - i)
    
print(count)
      

Fixed submission:
n = int(input())
count = 0

if n % 2 != 0:
  n += 1
 
for i in range(1, n // 2):
  if n - i == i:
    continue
    
  else:
    count += 1
    
print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
li = []

for i in range(1, n):
  if n - i == i or i in li:
    continue
    
  else:
    count += 1
    li.append(i)
    li.appned(n - i)
    
print(count)
      

Fixed submission:
n = int(input())
count = 0

if n % 2 != 0:
  n += 1
 
for i in range(1, n // 2):
  if n - i == i:
    continue
    
  else:
    count += 1
    
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
count = 0
li = []

for i in range(1, n):
  if n - i == i or [i, n - i] in li or [n - i, i] in li:
    continue
    
  else:
    count += 1
    li.append([i, n - i])
    
print(count)
      

Fixed submission:
n = int(input())
count = 0

if n % 2 != 0:
  n += 1
 
for i in range(1, n // 2):
  if n - i == i:
    continue
    
  else:
    count += 1
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(1, n + 1):
    print(a.index(i) + 1)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
output = [0] * n
for i, a in enumerate(a):
  output[a - 1] = i + 1
  
print(*output)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
output = []

for i in range(1, n + 1):
    output.append(a.index(i) + 1)

print(*output)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
output = [0] * n
for i, a in enumerate(a):
  output[a - 1] = i + 1
  
print(*output)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
point = {}
tmp = 0

for i in range(q):
    tmp = int(input())
    if tmp in point:
        point[tmp] += 1

    else:
        point[tmp] = 1

for b in range(1, n + 1):
    tmp = 0

    if b in point:
        tmp = sum(point.values()) - point[b]

    else:
        tmp = sum(point.values())

    if tmp >= k:
        print("No")

    else:
        print("Yes")


Fixed submission:
n, k, q = map(int, input().split())
point = {}
tmp = 0

for i in range(q):
    tmp = int(input())
    if tmp in point:
        point[tmp] += 1

    else:
        point[tmp] = 1

total = sum(point.values())

for b in range(1, n + 1):
    if b in point:
        if total - point[b] >= k:
            print("No")
        else:
            print("Yes")

    else:
        if total >= k:
            print("No")

        else:
            print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
point = {}
tmp = 0

for i in range(q):
    tmp = int(input())
    if tmp in point:
        point[tmp] += 1

    else:
        point[tmp] = 1

for b in range(1, n + 1):
    tmp = 0
    for c in point:
        if c == b:
            continue

        else:
            tmp += point[c]

    if tmp >= k:
        print("No")

    else:
        print("Yes")


Fixed submission:
n, k, q = map(int, input().split())
point = {}
tmp = 0

for i in range(q):
    tmp = int(input())
    if tmp in point:
        point[tmp] += 1

    else:
        point[tmp] = 1

total = sum(point.values())

for b in range(1, n + 1):
    if b in point:
        if total - point[b] >= k:
            print("No")
        else:
            print("Yes")

    else:
        if total >= k:
            print("No")

        else:
            print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
mod_list = [i for i in range(1, N)]
output = (N - 1) / 2 * (1 + N - 1)

print(int(output))

Fixed submission:
N = int(input())
output = ((N - 1) * N) // 2
 
print(int(output))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
mod_list = [i for i in range(1, N)]

print(sum(mod_list))

Fixed submission:
N = int(input())
output = ((N - 1) * N) // 2
 
print(int(output))
Buggy python submission (verdict: Runtime Error):
N = int(input())
v = list(map(int, input().split()))
i = 0

v.sort

for i in range(N - 1):
    v[i + 1] = (v[i] + v[i + 1]) / 2
    
print(v[-1])


Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
    
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input(.split())))
output =0

for i in range(N):
    output += 1 / A[i]
    
print(1 / output)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
output =0

for i in range(N):
    output += 1 / A[i]
    
print(1 / output)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, -1, 0):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")
        
            
        


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, 0, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, -1, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if k == 0:
        print("Yes")
        
            
        


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, 0, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = map(int, input().split())
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, -1, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if k == 0:
        print("Yes")
        
            
        

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, 0, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = []

for k in range(N):
    H.append(input())
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, -1, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if k == 0:
        print("Yes")
        

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, 0, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
output = 2018

for i in range(L, R + 1):
    for k in range(i + 1, R + 1):
        if output > i * k % 2019:
            output = i * k % 2019
            
print(output)

Fixed submission:
L, R = map(int, input().split())
output = 2018


for i in range(L, R + 1):
    for k in range(i + 1, R + 1):
        if output == 0:
            break

        if output > i * k % 2019:
            output = i * k % 2019
    else:
        continue
    break

print(output)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = list(map(int, input().split()))

D.sort()

print(D[N / 2] - D[N / 2 - 1]

Fixed submission:
N = int(input())
D = list(map(int, input().split()))

D.sort()

print(D[N // 2] - D[N // 2 - 1])
Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = map(int, input().split())
lcm = C * D // math.gcd(C, D)
tmp = (B // C - (A - 1) // C) + (B // D - (A - 1) // D) - (B // lcm - A // lcm)
output = B - A + 1 - tmp

print(output)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a

    if b == 0:
        return a

    else:
        return gcd(b, a % b)

A, B, C, D = map(int, input().split())
lcm = C * D // gcd(C, D)
tmp = (B // C - (A - 1) // C) + (B // D - (A - 1) // D) - (B // lcm - (A - 1) // lcm)
output = B - A + 1 - tmp

print(output)
Buggy python submission (verdict: Runtime Error):
D = int(input())

if D == 25:
    print("Christmas")

elif D == 24:
    print("Christmas Eve")

elif D == 23:
    print("Christmas Eve Eve")

else:
    print("Christmas Eve Eve Eve")

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

a.sort()

print((a[0] * a[1]) // 2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
even_list = [0] * (n + 1)
odd_list = [0] * (n + 1)

for i in range(n):
    if i % 2 == 0:
        even_list[v[i]] += 1

    else:
        odd_list[v[i]] += 1

if even_list.index(max(even_list)) == odd_list.index(max(odd_list)):
    even_sorted, odd_sorted = sorted(even_list), sorted(odd_list)
    print(min(n - even_sorted[-1] - odd_sorted[-2], n - even_sorted[-2] - odd_sorted[-1]))

else:
    print(n - max(even_list) - max(odd_list))


Fixed submission:
n = int(input())
v = list(map(int, input().split()))
even_list = [0] * (100000 + 1)
odd_list = [0] * (100000 + 1)

for i in range(n):
    if i % 2 == 0:
        even_list[v[i]] += 1

    else:
        odd_list[v[i]] += 1

if even_list.index(max(even_list)) == odd_list.index(max(odd_list)):
    even_sorted, odd_sorted = sorted(even_list), sorted(odd_list)
    print(min(n - even_sorted[-1] - odd_sorted[-2], n - even_sorted[-2] - odd_sorted[-1]))

else:
    print(n - max(even_list) - max(odd_list))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

print(sum(s) - n)


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

print(sum(a) - n)
Buggy python submission (verdict: Runtime Error):
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += i
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)


Fixed submission:
a, b = map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += i
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)

Buggy python submission (verdict: Runtime Error):
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += 1
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)


Fixed submission:
a, b = map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += i
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)

Buggy python submission (verdict: Runtime Error):
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += 1
    tower.append(tmp)
    
count = a - b

print(tower[count - 1] - b)

Fixed submission:
a, b = map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += i
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
k = int(input())
n = len(s)
substring = []

for i in range(n):
    tmp = ""
    for l in s[i::]:
        tmp += l
        if tmp in substring:
            continue

        else:
            substring.append(tmp)

substring.sort()

print(substring[k - 1])


Fixed submission:
s = list(input())
k = int(input())
n = len(s)
substring = []

for i in range(n):
    tmp = ""
    for l in s[i:i + k:]:
        tmp += l
        if tmp in substring:
            continue

        else:
            substring.append(tmp)

substring.sort()

print(substring[k - 1])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())

if a >= b:
    print(a)

else:
    print(a - 1)
    

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

if a <= b:
    print(a)

else:
    print(a - 1)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
output = "Yes"

for i in range(1, w - 1):
    for k in range(1, h - 1):
        if s[i - 1][k] == "." and s[i + 1][k] == "." and s[i][k - 1] == "." and s[i][k + 1] == ".":
            output = "No"

print(output)


Fixed submission:
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
ans = True

for i in range(h):
    for k in range(w):
        if s[i][k] == "#":
            count = True
            d = [[0, 1], [1, 0], [0, -1], [-1, 0]]
            for l in d:
                if 0 <= i + l[0] < h and 0 <= k + l[1] < w:
                    if s[i + l[0]][k + l[1]] == "#":
                        count = False
                        break

            if count:
                ans = False

print("Yes") if ans else print("No")

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
output = "Yes"

for i in range(1, w - 1):
    for k in range(1, h - 1):
        if s[i - 1][k] == "." and s[i + 1][k] == "." and s[i][k - 1] == "." and s[i][k + 1] == ".":
            output = "No"
            break

    else:
        break
    continue

print(output)


Fixed submission:
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
ans = True

for i in range(h):
    for k in range(w):
        if s[i][k] == "#":
            count = True
            d = [[0, 1], [1, 0], [0, -1], [-1, 0]]
            for l in d:
                if 0 <= i + l[0] < h and 0 <= k + l[1] < w:
                    if s[i + l[0]][k + l[1]] == "#":
                        count = False
                        break

            if count:
                ans = False

print("Yes") if ans else print("No")
Buggy python submission (verdict: Runtime Error):
from heapq import heappush,heappop
import queue
import re
import math
import functools
import numpy

def i_raw():
    return int(input())

def ss_raw():
    return input().split()

def is_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]

def gcd (a,b):
    if(b==0):
        return a
    return gcd(b,a%b)


def main():
    S,T = ss_raw()
    A,B = is_raw()
    U = input().strip()
    if U==S:
        return " ".join(map(str,[A-1,B]))
    else:
        return " ".join(map(str,[A,B-1]))  


print(main())


Fixed submission:
from heapq import heappush,heappop
import queue
import re
import math
import functools


def i_raw():
    return int(input())

def ss_raw():
    return input().split()

def is_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]

def gcd (a,b):
    if(b==0):
        return a
    return gcd(b,a%b)


def main():
    S,T = ss_raw()
    A,B = is_raw()
    U = input().strip()
    if U==S:
        return " ".join(map(str,[A-1,B]))
    else:
        return " ".join(map(str,[A,B-1]))  


print(main())
Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools
import itertools
import fractions

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29


def mk1d(n, val=INF):
    return [val for i in range(n)]

def mk2d(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]

DIV = 998244353

def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return functools.reduce(lcm_base, numbers, 1)


def floyd_warshall(costs):
    N = len(costs)
    for k in range(N):
        for i in range(N):
            for j in range(N):
                costs[i][j] = min(costs[i][j], costs[i][k]+costs[k][j])
    return costs

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)

def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret

def main():
    N,K = isRaw()
    As = isRaw()
    As.sort()
    dp = [0]*N
    dp[K-1] = As[K-1]-As[0]
    for n in range(K,N):
        dp[n] = dp[n-1]
        for idx in range(n-K+2):
            nCk = ncr(n-idx-1,K-2)
            dp[n] = (dp[n]+nCk*(As[n]-As[idx])+DIV)%DIV
    return dp[N-1]

if __name__ == "__main__":
    print(main())


Fixed submission:

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)

def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max,mod=DIV):
    fac,finv,inv = [0]*max, [0]*max, [0]*max
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod -inv[mod%i] * (mod//i)%mod
        finv[i] = finv[i-1]*inv[i]%mod
    class CONV:
        def __init__(self):
            pass
        def ncr(self,n,k):
            if(n<k):
                return 0
            if(n<0 or k<0 ):
                return 0
            return fac[n]*(finv[k]*finv[n-k]%mod)%mod
    return CONV()



def main():
    n,k = isRaw()
    As = list(isRaw())
    As.sort()
    ct = CONV_TBL(n)
    ans = 0

    for i in range(n):
        ans += As[i]*ct.ncr(i, k-1) - As[i]*ct.ncr(n-(i+1), k-1)
        ans = ans%DIV
    return ans

if __name__ == "__main__":
    print(main())
Buggy python submission (verdict: Runtime Error):
from heapq import heappush, heappop
import queue
import re
import math
import functools
import numpy


def s_raw():
    return input().rstrip("\r")

def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    

def main():
    a = int_raw()
    s = s_raw()
    if a >=3200:
        return s
    else:
        return "red"

if __name__ == "__main__":
    print(main())


Fixed submission:
from heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())

def str_in():
    return input().strip("\n")

def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.mini = [i for i in range(n+1)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
        mini = min(self.mini[x],self.mini[y])
        self.mini[x]=mini
        self.mini[y]=mini
    
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def main():
    a = int_raw()
    s = input().strip("\n")
    return s if a >=3200 else "red"

    
print(main())
Buggy python submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


DIV = 10**9+7

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    ans = 0
    N = int_raw()
    bxys = [ints_raw() for _ in range(N)]
    bxys.sort()
    dtables = {}
    for idx in range(1,N):
        dxy = (bxys[idx][0]-bxys[idx-1][0],bxys[idx][1]-bxys[idx][1])
        if dxy in dtables:
            dtables[dxy]+=1
        else:
            dtables[dxy]=1
    dmax = max(dtables.values())
    return N-dmax

print(main())


Fixed submission:
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


DIV = 10**9+7

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    ans = 0
    N = int_raw()
    bxys = [ints_raw() for _ in range(N)]
    if N==1:
        return 1
    bxys.sort()
    dtables = {}

    for idx in range(0,N):
        for idx2 in range(idx+1,N):
            dxy = (bxys[idx2][0]-bxys[idx][0],bxys[idx2][1]-bxys[idx][1])
            if dxy in dtables:
                dtables[dxy]+=1
            else:
                dtables[dxy]=1
    dmax = max(dtables.values())
    return N-dmax

print(main())