Harryxun/stf_run huggingface dataset:
X,N = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]

if N != 0:
    sorted_p = sorted(p)

    for x in range(N-1):
        diff = abs(X - sorted_p[x])
        if diff < abs(X-sorted_p[x+1]):
            break
        elif x == N-2 and diff > abs(X-sorted_p[x+1]):
            x = N-1
    
    print(x)
        
    def checknum(d,loweridx,upperidx):
        upper = sorted_p[upperidx]
        lower = sorted_p[loweridx]
        if X-d == lower:
            if X+d == upper:
                if loweridx == 0:
                elif upperidx == N-1:
                else:
                    checknum(d+1,loweridx-1,upperidx+1)
            elif X-d == lower and X+d != upper:
                print(X+d)        
        else:
            return print(X-d)

    if x == 0:
        print(X-1)
    elif x == N-1:
        a=1
        while(sorted_p[x-a] == X):
            a += 1
        if sorted_p[x-a] != X-1:
            print(X-1)
        else:
            print(X+1)
    else:
        checknum(1,x-1,x+1)
elif not(X in sorted_p):
    print(X)
else:
    print(X)

### FIXED CODE ###

X,N = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]

for d in range(X+1):
    for f in [-1,1]:
        a = X + d*f
        if p.count(a) == 0:
            print(a)
            exit()
num = int(input())
if (num < 1200):
  print("ABC")
elif (num < 2800):
  print("ARC")
else
  print("AGC")

### FIXED CODE ###

num = int(input())
if (num < 1200):
  print("ABC")
elif (num < 2800):
  print("ARC")
else:
  print("AGC")
a,b=map(int, input().split())
if a-2b>0:
  print(a-2b)
else:
   print(0)

### FIXED CODE ###

a,b=map(int, input().split())
if a-2*b>0:
  print(a-2*b)
else: 
  print(0)
a,b,c,d=input()
print("Yes" a==b==c or b==c==d else "No")

### FIXED CODE ###

a,b,c,d=input()
print("Yes" if a==b==c or b==c==d else "No")
N = int(input())
a = list(map(int, input().split()))

ans = 10000000000
aa = sum(a)

for i in range(N-1):
    sum_a = sum(a[:i+1])
    sum_b = a-sum_a
    sa = abs(sum_a-sum_b)
    ans = min(ans, sa)

print(ans)


### FIXED CODE ###

input()
cards = tuple(map(int, input().split(' ')))

a = sum(cards[1:])
s = cards[0]
diff_min = abs(a - s)

for card in cards[1:-1]:
    a -= card
    s += card
    diff_min = min(diff_min, abs(a - s))

print(diff_min)
n=int(input())
pf={}
m=n
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
ans=[]
m=0
for i in range(1, int(n**0.5)+1):
    if n%i==0:
        m=n//i-1
        if n%m==i and n//m==i:
            ans.append(m)

#print(int(n**0.5))
print(sum(ans))

### FIXED CODE ###

n=int(input())
if n==1:
    print(0)
else:
    pf={}
    m=n
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    ans=[]
    m=0
    for i in range(1, int(n**0.5)+1):
        if n%i==0:
            m=n//i-1
            if n%m==i and n//m==i:
                ans.append(m)

    #print(int(n**0.5))
    print(sum(ans))
from bisect import bisect_left
N,K=map(int, input().split())
A=list(map(int, input().split()))
p=10**9+7
A=sorted(A)
thresh=bisect_left(A,0)
minus=A[:thresh]
plus=A[thresh:][::-1]

#print(plus, minus)
if len(plus)==0:
    ans=1
    if K%2!=0:
        minus=minus[::-1]
        for i in range(K):
            ans*=minus[i]
            ans%=p
    else:
        for i in range(K):
            ans*=minus[i]
            ans%=p
    print(ans)
    exit()

if len(minus)==0:
    ans=1
    for i in range(K):
        ans*=plus[i]
        ans%=p
    print(ans)
    exit()

midx=0
pidx=0
ans=1
while K>0 and (0<=midx<len(minus) or 0<=pidx<len(plus)):
    if midx==len(minus)-1:
        nexmin=minus[midx]
    elif 0<=midx<len(minus)-1:
        nexmin=minus[midx]*minus[midx+1]
    else:
        nexmin=-1


    if pidx==len(plus)-1:
        nexplus=plus[pidx]
    elif 0<=pidx<len(plus)-1:
        
        nexplus=plus[pidx]*plus[pidx+1]
    else:
        nexplus=-float("INF")

    if nexmin>=nexplus and K>=2:
        ans*=nexmin
        ans%=p
        midx+=2
        K-=2
    else:
        ans*=plus[pidx]
        ans%=p
        pidx+=1
        K-=1

print(ans)



### FIXED CODE ###

from bisect import bisect_left
N,K=map(int, input().split())
A=list(map(int, input().split()))
p=10**9+7
A=sorted(A)
thresh=bisect_left(A,0)
minus=A[:thresh]
plus=A[thresh:][::-1]

#print(plus, minus)
if len(plus)==0:
    ans=1
    if K%2!=0:
        minus=minus[::-1]
        for i in range(K):
            ans*=minus[i]
            ans%=p
    else:
        for i in range(K):
            ans*=minus[i]
            ans%=p
    print(ans)
    exit()

if len(minus)==0:
    ans=1
    for i in range(K):
        ans*=plus[i]
        ans%=p
    print(ans)
    exit()

midx=0
pidx=0
ans=1

while K>0 and (0<=midx<len(minus) or 0<=pidx<len(plus)):
    if midx==len(minus)-1:
        nexmin=minus[midx]
    elif midx>=len(minus):
        nexmin=-1
    else:
        if K>=2:
            nexmin=minus[midx]*minus[midx+1]
        else:
            nexmin=minus[midx]

    if pidx==len(plus)-1:
        nexplus=plus[pidx]
        fact=nexplus
    elif pidx>=len(plus):
        nexplus=-float("INF")
        fact=nexplus
    else:
        #if plus[pidx+1]!=0:
        #    nexplus=plus[pidx]*plus[pidx+1]
        #else:
        #    nexplus=plus[pidx]
        if K>=2:
            nexplus=plus[pidx]*plus[pidx+1]
        else:
            nexplus=plus[pidx]
        fact=plus[pidx]

    if nexmin>=nexplus:
        ans*=nexmin
        ans%=p
        midx+=2
        K-=2
    else:
        ans*=fact
        ans%=p
        pidx+=1
        K-=1


print(ans)
from math import *
N = int(input())
T = []
A = []
for i in range(0, N):
    ti, ai = [int(x) for x in input().split()]
    T.append(ti)
    A.append(ai)
 
prevT = T[0]
prevA = A[0]
for i in range(1, N):
    nextfacT = int(ceil(prevT / T[i]))
    nextfacA = int(ceil(prevA / A[i]))
    nextfac = max(nextfacT, nextfacA)
    while(nextfac * T[i] < prevT and nextfac * A[i] < prevA):
        nextfac += 1
    prevT = nextfac * T[i]
    prevA = nextfac * A[i]
 
print(prevA+prevT)
from math import *
N = int(input())
T = []
A = []
for i in range(0, N):
    ti, ai = [int(x) for x in input().split()]
    T.append(ti)
    A.append(ai)
 
prevT = T[0]
prevA = A[0]
for i in range(1, N):
    nextfacT = int(ceil(prevT / T[i]))
    nextfacA = int(ceil(prevA / A[i]))
    nextfac = max(nextfacT, nextfacA)
    while(nextfac * T[i] < prevT and nextfac * A[i] < prevA):
        nextfac += 1
    prevT = nextfac * T[i]
    prevA = nextfac * A[i]
 
print(prevA+prevT)

### FIXED CODE ###

def compute_current_score(previous_t_score, previous_a_score, current_t_ratio, current_a_ratio):
    initial_divisor = max(previous_t_score // current_t_ratio, previous_a_score // current_a_ratio)
    current_t_score = 0
    current_a_score = 0
    while(True):
        current_t_score = initial_divisor * current_t_ratio
        current_a_score = initial_divisor * current_a_ratio
        if((current_t_score >= previous_t_score) and (current_a_score >= previous_a_score)):
            break
        initial_divisor += 1
    return current_t_score, current_a_score

N = int(input())
t_score, a_score = list(map(int, input().strip().split()))

for  n in range(N-1):
    t_ratio, a_ratio = list(map(int, input().strip().split()))
    t_score, a_score = compute_current_score(t_score, a_score, t_ratio, a_ratio)
    
print(t_score + a_score)
N=int(input())
x0,x1,x2,x3=0,0,0,0

for i in range(N)
	Si=input()
  	if Si=='AC':
      x0=x0+1
    
    if Si=='WA':
      x1=x1+1
    
    if Si=='TLE':
      x2=x2+1
    
    if Si=='RE':
      x3=x3+1

print('AC x' str(x0)
print('WA x' str(x1)
print('TLE x' str(x2)
print('RE x' str(x3))

### FIXED CODE ###

N = int(input())
C0, C1, C2, C3 = 0, 0, 0, 0
for i in range(N):
    Si = input()
    if Si == 'AC':
        C0 += 1
 
    elif Si == 'WA':
        C1  += 1
 
    elif Si == 'TLE':
        C2 += 1
 
    else:
        C3 += 1
 
print('AC x ' + str(C0))
print('WA x ' + str(C1))
print('TLE x ' + str(C2))
print('RE x ' + str(C3))
import sys
import math
import itertools
from heapq import heapify, heappop, heappush
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))


##### Library ####


##### main #####
def main():

    input_S = input()
    K = I() - 1

    # input_S = 'abcaa'
    # K = 2

    len_S = len(input_S)
    unique_S = len(set(input_S))
    
    lis = set()
    min_s = 'z'

    if len_S == 1:
        print(input_S)

    else:
        for i in range(len_S):
            for j in range(len_S):
                if input_S[j] > min_s:
                    continue

                s = input_S[j:j+i+1]
                lis.add(s)

            if len(lis) < K:
                k = unique_S-1
            else:
                k = K
            tmp = sorted(lis)[k]
            if min_s == tmp:
                sys.exit()
            min_s = tmp
        print(sorted(lis)[K])

   
if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys
import math
import itertools
from heapq import heapify, heappop, heappush
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))


##### Library ####


##### main #####
def main():

    input_S = input()
    K = I() - 1

    # input_S = 'abcaa'
    # K = 2

    len_S = len(input_S)
    unique_S = len(set(input_S))
    
    lis = set()
    min_s = 'z'

    if len_S == 1:
        print(input_S)

    else:
        for i in range(5):
            for j in range(len_S):
                if input_S[j] > min_s:
                    continue

                s = input_S[j:j+i+1]
                lis.add(s)

        print(sorted(lis)[K])

   
if __name__ == '__main__':
    main()
import math
a,b,x = map(int,input().split())

if x>=a*a*b/2:
  tanθ = math.degrees(math.atan(a**2/(2*(a*b-x/a))))
else:
  tanθ = math.degrees(math.atan(2*x/(a*b*b)))

print(90-tanθ)

### FIXED CODE ###

import math
a,b,x = map(int,input().split())

if x==a*a*b:
  tanθ = 90
elif a*a*b>x>=a*a*b/2:
  tanθ = math.degrees(math.atan(a**2/(2*(a*b-x/a))))
else:
  tanθ = math.degrees(math.atan(2*x/(a*b*b)))

print(90-tanθ)
n,a,b = map(int,input().split())
sum1 = 0
ans = 0
for i in range(1,n+1):
  for j in range(len(str(i)):
    sum1 +=str(i)[j]
  if a<= sum1 <=b:
    ans += sum1
print(ans)

### FIXED CODE ###

n,a,b = map(int,input().split())

ans = 0
n = str(n)
num = 1
while num <= int(n):
    sum1 = 0
    for s in str(num):
        sum1 += int(s)
        
    if a <= sum1 <= b:
        ans += num
        
    num += 1
    
print(ans)
N = int(input())
A = list(map(int, input().split()))
dict1 = {}
for i in range(N):
  if A[i] not in dict1.keys():
    dict1[A[i]] = 0
  else:
    dict1[A[i]] += 1
value1 = []
for value in dict1.values():
  value1.append(value)
value2 = sorted(value1, reverse = True)
if value2[0] - value2[1] >= sum(value2[1:]):
  print(N - (value2[0] * 2))
else:
  if(sum(value2[0:]) % 2 == 0):
    print(len(value2))
  else:
    print(len(value2 - 1))
    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
dict1 = {}
for i in range(N):
  if A[i] not in dict1.keys():
    dict1[A[i]] = 0
  else:
    dict1[A[i]] += 1
value1 = []
for value in dict1.values():
  value1.append(value)
value2 = sorted(value1, reverse = True)
if len(value2) != 1:
  if value2[0] - value2[1] >= sum(value2[1:]):
    print(N - (value2[0] * 2))
  else:
    if(sum(value2[0:]) % 2 == 0):
      print(len(value2))
    else:
      print(len(value2) - 1)
else:
  print(1)
def main():
    N = int(input())
    A = list(map(int, input().split()))
    a = A.count(1)
    b = A.count(2)
    c = A.count(3)
    floatN = N*1.0
    dp = [[[0]*(N+1) for i in range(N+1)] for j in range(N+1)]

    for k in range(A[3]+1):
        for j in range(A[2]+A[3] + 1 - k):
            for i in range(N + 1 - k - j):
                if i + j+k == 0:
                    continue
                dp[i][j][k] = floatN
                if i > 0:
                    dp[i][j][k] += dp[i-1][j][k] * i
                if j > 0:
                    dp[i][j][k] += dp[i+1][j-1][k] * j
                if k > 0:
                    dp[i][j][k] += dp[i][j+1][k-1] * k
                dp[i][j][k] /= (i+j+k)
    print(dp[a][b][c])


main()


### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
    a = A.count(1)
    b = A.count(2)
    c = A.count(3)
    floatN = N*1.0
    dp = [[[.0]*(N+1) for i in range(N+1)] for j in range(N+1)]

    for k in range(c+1):
        for j in range(b+c + 1 - k):
            for i in range(N + 1 - k - j):
                if i + j+k == 0:
                    continue
                dp[i][j][k] = floatN
                if i > 0:
                    dp[i][j][k] += dp[i-1][j][k] * i
                if j > 0:
                    dp[i][j][k] += dp[i+1][j-1][k] * j
                if k > 0:
                    dp[i][j][k] += dp[i][j+1][k-1] * k
                dp[i][j][k] /= (i+j+k)
    print(dp[a][b][c])


main()
#わからんテスト
import copy

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

t = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
L = {}
for i in A:
  if t[i] in L:
    if L[t[i]] < i:
      L[t[i]] = i
  else:
    L[t[i]] = i

dp = [[0 for j in range(10)] for i in range(N)]
for i in L.items():
  dp[i[0] - 1][i[1]] = 1

### FIXED CODE ###

import copy

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

t = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
L = {}
for i in A:
  if t[i] in L:
    if L[t[i]] < i:
      L[t[i]] = i
  else:
    L[t[i]] = i

dp = [[0 for j in range(10)] for i in range(N)]
for i in L.items():
  if i[0] - 1 < N:
    dp[i[0] - 1][i[1]] = 1
for i in range(N):
  if max(dp[i]) == 0:
    continue
  for j in L.items():
    k = i + j[0]
    if k < N:
      t = copy.deepcopy(dp[i])
      t[j[1]] += 1
      if sum(t) > sum(dp[k]):
        dp[k] = t
      else:
        for ii in range(9, 0, -1):
          if t[ii] > dp[k][ii]:
            dp[k] = t
            break
          elif t[ii] < dp[k][ii]:
            break
          
t = dp[-1]
Ans = ""
for i in range(9, 0, -1):
  for j in range(t[i]):
    Ans += str(i)
    
print(Ans)
lis_raw=input().split()
lis = [int(i) for i in lis]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

### FIXED CODE ###

a, b=map(int, input().split())
print(max(a + b, a - b, a*b))
import sys
readline = sys.stdin.readline

N = int(readline())
A = list(map(int, readline().split()))

INF = 10**18
limit = 5
dpb = [-INF]*(2*limit+3)
dpw = [-INF]*(2*limit+3)
dpw[0] = 0
for i in range(N):
    a = A[i]
    dpb2 = [-INF]*N
    dpw2 = [-INF]*N
    for j in range(-limit, limit):
        if -limit <= j - 1 < limit:
            dpw2[j-1] = max(dpw2[j-1], dpb[j], dpw[j])
            dpb2[j-1] = max(dpb2[j-1], dpb[j], dpw[j])
        if -limit <= j + 1 < limit:
            dpb2[j+1] = max(dpb2[j+1], dpw[j]+a)
    dpw = dpw2[:]
    dpb = dpb2[:]

idx = N//2*2 - N
print(max(dpw[idx], dpb[idx]))
    

### FIXED CODE ###

import sys
readline = sys.stdin.readline

N = int(readline())
A = list(map(int, readline().split()))

INF = 10**18
limit = 4
S = (2*limit+3)
dpb = [-INF]*S
dpw = [-INF]*S
dpw[0] = 0
for i in range(N):
    a = A[i]
    dpb2 = [-INF]*S
    dpw2 = [-INF]*S
    for j in range(-limit, limit):
        if -limit <= j - 1 < limit:
            dpw2[j-1] = max(dpw2[j-1], dpb[j], dpw[j])
            dpb2[j-1] = max(dpb2[j-1], dpb[j], dpw[j])
        if -limit <= j + 1 < limit:
            dpb2[j+1] = max(dpb2[j+1], dpw[j]+a)
    dpw = dpw2[:]
    dpb = dpb2[:]

idx = N//2*2 - N
print(max(dpw[idx], dpb[idx]))
c=input()
print (chr(ord(c) + 1)


### FIXED CODE ###

c=input()
a=[chr(i) for i in range(97, 97+26)]
print(a[a.index(c)+1])
#import sys

import numpy as np


def main(n,k,p,c):
    ans = -10**9
    for i in range(n):
        x = i
        t = k
        count = 0
        l = True
        sub = 0
        ln = 0
        while True:
            x = p[x] - 1
            if l:
                count += c[x]
                ln += 1
                if x == i:
                    if t > ln:
                        if count > 0:
                            sub += (t // ln - 1) * count
                            t %= ln
                            t += ln
                        else:
                            t = 0
                    l = False
            sub += c[x]
            t -= 1
            ans = max(sub, ans)
            if t < 1:
                break
    return ans


# >>> numba compile >>>
#if sys.argv[-1]=='ONLINE_JUDGE':
#  from numba.pycc import CC
#  cc=CC('my_module')
#  cc.export('main','i8(i8,i8,i8[:],i8[:])')(main)
#  cc.compile()
#  exit()
#from my_module import main
# <<< numba compile <<<
(n, k), p, c = [np.int_(i.split()) for i in open(0)]
print(main(n,k,p,c))


### FIXED CODE ###

(n, k), p, c = [[*map(int, i.split())] for i in open(0)]

def solve(x, t):
    visit = [0] * n
    visit[x] = 1
    loop = [0] * n
    count = 0
    ans = c[p[x] - 1]
    l = True
    sub = 0
    while True:
        x = p[x] - 1
        if l:
            if visit[x]:
                if loop[x]:
                    ln = sum(loop)
                    if t > l:
                        sub += (t//ln -1)*count*(count>0)
                        t %= ln
                        t += ln
                    l = False
                count += c[x]
                loop[x] = 1
            visit[x] = 1
        sub += c[x]
        t -= 1
        ans = max(sub, ans)
        if t < 1:
            return ans


print(max(solve(i, k) for i in range(n)))
import scipy as sp

N, K = list(map(int, input().split()))

tree = [int(input()) for i in range(N)]

tree.sort()

print(min(tree[N-K+i] - tree[i] for i in range(N-K+1)))
    

### FIXED CODE ###

N, K = list(map(int, input().split()))

tree = [int(input()) for i in range(N)]

tree.sort()

print(min(tree[i+K-1] - tree[i] for i in range(N-K+1)))
N = int(input())
price_list = []
append = pricelist.append
for i in range(N):
	p = int(input)
    append(p)
pricelist.sort(reverse=True)
pricelist[0] = pricelist[0] / 2
print(sum(pricelist))

### FIXED CODE ###

N = int(input())
price_list = []
append = price_list.append
for i in range(N):
    p = int(input())
    append(p)
price_list.sort(reverse=True)
price_list[0] = price_list[0] // 2
print(sum(price_list))
N = int(input())

ans = 0
for i in range(1,N);
	ans += (N-1)//i
print(ans)

### FIXED CODE ###

N = int(input())

ans = 0
for i in range(1,N):
	ans += (N-1)//i
print(ans)
N=input()
c=0
for i in len(N):
  c+=int(N[i])
if c%9==0:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

N=input()
c=0
for i in range(len(N)):
  c+=int(N[i])
if c%9==0:
  print("Yes")
else:
  print("No")
a,b,c,k=map(int,input().split())
ans
if(a>=k):
    ans=k
else:
    if((a+b)>=k):
        ans=a
    else:
        x=k-a-b
        ans=a-x
print(ans)

### FIXED CODE ###

a,b,c,k=map(int,input().split())
ans=0
if(a>=k):
    ans=k
else:
    if((a+b)>=k):
        ans=a
    else:
        x=k-a-b
        ans=a-x
print(ans)
a, b = map(int, input().split())
for i in range(1, 10**5):
    if (i*8) // 100 == a and i // 10 == b:
        print(n)
        exit()
print(-1)

### FIXED CODE ###

a, b = map(int, input().split())
for i in range(1, 10**5):
    if (i*8) // 100 == a and i // 10 == b:
        print(i)
        exit()
print(-1)
import math
N=int(input())
Min=N/1.08
Max=(N+1)/1.08
Mi=int(math.ceil(Min))
Ma=int(math.floor(Max))
if Ma<Mi:
  print(":(")
else:
  print(Mi)

### FIXED CODE ###

M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if M2==M1+1:
  print(1)
else:
  print(0)
n = int(input())

balls=[]
for i in range(n):
  x,y = map(int, input().split())
  balls.append([x,y])

balls.sort()  
sorted(balls, key=lambda x: x[1])

hyo={}

for i in range(n):
  for j in range(i+1,n):
    difx=balls[j][0]-balls[i][0]
    dify=balls[j][1]-balls[i][1]
    if (difx,dify) in hyo.keys():
      hyo[(difx,dify)] +=1
    else:
      hyo[(difx,dify)] =1

#print(hyo)
p,q=max(hyo,key=hyo.get)

chk=[1]*n

for i in range(n-1,-1,-1):
  x=balls[i][0]-p
  y=balls[i][1]-q
  if [x,y] in balls:
    chk[i]=0
#print(balls)
#print(chk)
print(sum(chk))


### FIXED CODE ###

n = int(input())

if n==1:
  print(1)
  exit()

balls=[]
for i in range(n):
  x,y = map(int, input().split())
  balls.append([x,y])

balls.sort()  
sorted(balls, key=lambda x: x[1])

hyo={}

for i in range(n):
  for j in range(i+1,n):
    difx=balls[j][0]-balls[i][0]
    dify=balls[j][1]-balls[i][1]
    if (difx,dify) in hyo.keys():
      hyo[(difx,dify)] +=1
    else:
      hyo[(difx,dify)] =1

#print(hyo)
p,q=max(hyo,key=hyo.get)

chk=[1]*n

for i in range(n-1,-1,-1):
  x=balls[i][0]-p
  y=balls[i][1]-q
  if [x,y] in balls:
    chk[i]=0
#print(balls)
#print(chk)
print(sum(chk))
import copy
n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

dp = [[0] * 2 for _ in range(n_num + 1)]
dp[0][0] = 1
for i in range(n_num):
    nxt = [[0] * 2 for _ in range(n_num + 1)]
    for j in range(n_num):
        for l in range(2):
            lim = 9 if l else n_list[i]
            for x in range(lim + 1):
                if x != 0:
                    ns = j + 1
                else:
                    ns = j
                nlt = l | (x < n_list[i])
                nxt[ns][nlt] += dp[j][l]
    dp = copy.deepcopy(nxt)
ans = dp[k][0] + dp[k][1]
print(ans)

### FIXED CODE ###

n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

if n_num < k:
    print('0')
else:

    dp = [[[0] * (n_num + 1) for _ in range(2)]for _ in range(n_num + 1)]

    dp[0][0][0] = 1
    for i in range(n_num):
        for smaller in range(2):
            for j in range(n_num):
                lim = 9 if smaller else n_list[i]
                for x in range(lim + 1):
                    if x != 0:
                        ns = j + 1
                    else:
                        ns = j
                    nlt = smaller | (x < n_list[i])
                    dp[i + 1][nlt][ns] += dp[i][smaller][j]
    ans = dp[n_num][0][k] + dp[n_num][1][k]
    print(ans)
D = int().input()
if D==22:
  print("Christmas Eve Eve Eve")
else if D == 23:
  print("Christmas Eve Eve")
else if D == 24:
  print("Christmas Eve")
else:
  print("Cristmas")

### FIXED CODE ###

D = int(input())
if D ==22:
  print("Christmas Eve Eve Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 24:
  print("Christmas Eve")
else:
  print("Christmas")
def connect(a, b):
  return b + a

s = input()
t = input()
print(connect(s, t))

### FIXED CODE ###

def connect(s):
  return s[1] + s[0]

s = input().split()
print(connect(s))
s = list(str(input()))
if s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import sys
s = list(str(input()))
if len(s)<4:
    print('No')
    sys.exit()
if s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I':
    print('Yes')
else:
    print('No')
s = int(input().replace('/',''))
if s > 20190420:
    print("TBD")
else]
    print("Heisei")

### FIXED CODE ###

s = int(input().replace('/',''))
if s > 20190430:
    print("TBD")
else:
    print("Heisei")