Harryxun/stf_run huggingface dataset:
Point = complex


N, *XY = map(int, open(0).read().split())

P = [Point(x, y) for x, y in zip(*[iter(XY)] * 2)]

def max_distance(center):
    return max(abs(center - p) for p in P)

def ternary_search(f, left, right, MAX_ITER=100):
    for _ in range(MAX_ITER):
        m1 = (left * 2 + right) / 3
        m2 = (left + right * 2) / 3
        if f(m1) < f(m2):
            right = m2
        else:
            left = m1
    return f(left)

def g(x):
    return ternary_search(lambda y: max_distance(Point(x, y)), -1000, 1000)

print(ternary_search(g, -1000, 1000))

### FIXED CODE ###

mod = 10 ** 9 + 7

class ModComb:
    def __init__(self, MAX, mod=10 ** 9 + 7):
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, MAX):
            fac.append(fac[i - 1] * i % mod)
            inv.append(mod - inv[mod % i] * (mod // i) % mod)
            finv.append(finv[i - 1] * inv[i] % mod)
        self.fac, self.finv, self.mod = fac, finv, mod

    def nCk(self, n, k):
        if n < k or n < 0 or k < 0:
            return 0
        fac, finv, mod = self.fac, self.finv, self.mod
        return fac[n] * (finv[k] * finv[n - k] % mod) % mod


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

mc = ModComb(2 * N)

ans = mc.nCk(2 * N - 1, N - 1)
if K + 1 < N:
    ans += sum((mod - mc.nCk(N, i)) * mc.nCk(N - 1, i) % mod for i in range(K + 1, N)) % mod

print(ans % mod)
N = int(input())
W = [int(i) for i in input().split()]
for i in range (N):
  slice1 =  W[0,i]
  slice2 = W[i,0]
  print(slice1,slice2)



list.append(s1 -s2)
z =min(list)
print(z)

### FIXED CODE ###

N = int(input())
W = [int(i) for i in input().split()]
list = []


for i in range (N):
  s1 =0
  s2 =0
  slice1 =  W[0:i]
  for t in slice1:
    s1 += t
  slice2 = W[i:N]
  for t in slice2:
    s2 += t
  z = s1 - s2
  if z < 0:
    z*= -1
  list.append(z)
z =min(list)

print(z)
import bisect


def CumulativeSum(l):
    a = [0]
    for i in l:
        a.append(a[-1] + i)
    return a[1:]


def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    b = CumulativeSum(a)
    s = b[-1]
    h = s // 2
    x = bisect.bisect_left(b, h)
    try:
        m = (b[x], b[x + 1], b[x - 1])
    except:
        m = (b[x])
    if s % 2 == 0 and h in m:
        print(0)
        return

    print(min([abs(x * 2 - s) for x in m]))


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect


def CumulativeSum(l):
    a = [0]
    for i in l:
        a.append(a[-1] + i)
    return a[1:]


def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    b = CumulativeSum(a)
    s = b[-1]
    h = s // 2
    x = bisect.bisect_left(b, h)
    try:
        m = (b[x], b[x + 1], b[x - 1])
    except:
        m = (b[x], b[x - 1])
    if s % 2 == 0 and h in m:
        print(0)
        return

    print(min([abs(x * 2 - s) for x in m]))


if __name__ == '__main__':
    resolve()
import numpy as np

n = int(input())
x = list(map(int, input().split()))

def numpy_gcd(a, b):
    a, b = np.broadcast_arrays(a, b)
    a = a.copy()
    b = b.copy()
    pos = np.nonzero(b)[0]
    while len(pos) > 0:
        b2 = b[pos]
        a[pos], b[pos] = b2, a[pos] % b2
        pos = pos[b[pos] != 0]
    return a

while len(x) > 1:
    i = 0
    next = []
    while i < len(x) - 1:
        next.append(numpy_gcd(x[i],x[i+1]))
        i += 2

    x = [] + next

print(x[0])

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))

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

while len(x) > 1:
    i = 0
    next = []
    while i < len(x) - 1:
        next.append(gcd(x[i], x[i+1]))
        i += 2

    x = [] + next

print(x[0])
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
dic_A = {0:1}
direction = 0
for i in range(K):
    direction = A_list[direction]-1
    if direction in dic_A:
        dic_A[direction] += 1
        if dic_A[direction] >= 3:
            break
    else:
        dic_A[direction] = 1
cnt = 0
dic_ans = {}
for k, v in dic_A.items():
    if v >= 2:
        cnt += 1
        dic_ans[k] = 1
ans = K - (len(dic_A) - cnt)
ans %= cnt
for k, v in dic_ans.items():
    if ans == 0:
        true = k
        break
    ans -= 1
print(true+1)


### FIXED CODE ###

N, K = map(int, input().split())
A_list = list(map(int, input().split()))
dic_A = {0:1}
direction = 0
flag = True
for i in range(K):
    direction = A_list[direction]-1
    if direction in dic_A:
        dic_A[direction] += 1
        if dic_A[direction] >= 3:
            flag = False
            break
    else:
        dic_A[direction] = 1
if flag:
    print(direction+1)
    exit()
cnt = 0
dic_ans = {}
for k, v in dic_A.items():
    if v >= 2:
        cnt += 1
        dic_ans[k] = 1
ans = K - (len(dic_A) - cnt)
ans %= cnt
for k, v in dic_ans.items():
    if ans == 0:
        true = k
        break
    ans -= 1
print(true+1)
N, W = map(int, input().split())
w = []
v = []
Vmax = 100 * N

for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

inf = float('inf')
dp = [[inf] * (Vmax+1) for _ in range(N)]
dp[0][0] = 0
dp[0][v[0]] = w[0]

for i in range(1,N):
    for j in range(Vmax):

        if dp[i-1][j] != inf:
            dp[i][j] = dp[i-1][j]

            if dp[i-1][j] + w[i] <= W:
                dp[i][j+v[i]] = min(dp[i][j+v[i]], dp[i-1][j] + w[i])
        
ans = 0
for j in range(Vmax):
    if dp[N-1][j] <= W:
        ans = j

print(ans)

### FIXED CODE ###

N,W=map(int,input().split())
w=[]
v=[]
for i in range(N):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
dp=[[10**22]*(N*(10**3)+1) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    for j in range(N*(10**3)+1):
        if j>=v[i-1]:
            dp[i][j]=min(dp[i-1][j-v[i-1]]+w[i-1],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(N*(10**3),-1,-1):
    if dp[N][i]<=W:
        print(i)
        break
def resolve():
    H,W,K = map(int,input().split())
    bi = []
    bj = []
    for i in range(H):
        row = input()
        for j in range(W):
            if row[j]=='#':
                bi.append(i)
                bj.append(j)

    row_iters = [itertools.combinations(range(H), i) for i in range(0,H+1)]
    column_iters = [itertools.combinations(range(W), i) for i in range(0,W+1)]

    dellist = lambda items, indexes: [item for index, item in enumerate(items) if index not in indexes]
    # 行を削除してみる
    count = 0

    for row_iters in row_iters:
        for target_rows in row_iters:
            row_del_position = [i_position for i_position, i in enumerate(bi) for target_row in target_rows if i == target_row]
            new_bi = dellist(bi, row_del_position)
            new_bj = dellist(bj, row_del_position)
            if len(new_bi)>=K:
                for column_iters in column_iters:
                    for target_columns in column_iters:
                        column_del_position = [j_position for j_position, j in enumerate(bj) for target_column in target_columns if j == target_column]
                        new_bi = dellist(bi, column_del_position)
                        new_bj = dellist(bj, column_del_position)
                        if len(new_bi) == K:
                            count +=1
    print(count)
resolve()

### FIXED CODE ###

import itertools
def resolve():
    H,W,K = map(int,input().split())
    bi = []
    bj = []
    for i in range(H):
        row = input()
        for j in range(W):
            if row[j]=='#':
                bi.append(i)
                bj.append(j)
    
    dellist = lambda items, indexes: [item for index, item in enumerate(items) if index not in indexes]
    # 行を削除してみる
    count = 0

    row_iters = [itertools.combinations(range(H), i) for i in range(0,H+1)]
    for row_iter in row_iters:
        for target_rows in row_iter:
            row_del_position = [i_position for i_position, i in enumerate(bi) for target_row in target_rows if i == target_row]
            #new_bi = dellist(bi, row_del_position)
            new_bj = dellist(bj, row_del_position)
            if len(new_bj)>=K:
                #print('bi>=K')
                #print(target_rows)
                #print(new_bi, new_bj)
                column_iters = [itertools.combinations(range(W), i) for i in range(0,W+1)]
                for column_iter in column_iters:
                    for target_columns in column_iter:
                        column_del_position = [j_position for j_position, j in enumerate(new_bj) for target_column in target_columns if j == target_column]
                        #new_bi2 = dellist(new_bi, column_del_position)
                        new_bj2 = dellist(new_bj, column_del_position)
                        
                        if len(new_bj2) == K:
                            #print('bi==K')
                            #print(target_columns)
                            count +=1
    print(count)
resolve()
n = int(input())
h_l = list(map(int,input().split()))
cnt = 0
for i in range(n):
    h_i = h_l[i]
    cnt += sum([1 for j in range(i,n) if((j-i)==(h_l[j]+h_i))])
            

print(cnt)

### FIXED CODE ###

x = int(input())
sign = ((1,1),(1,-1),(-1,1),(-1,-1))
isloop=True
for a in range(10**3):
    if(isloop==False):
        break
    for b in range(10**3):
        if(isloop==False):
            break
        for s1,s2 in sign:
            if(isloop==False):
                break
            a1 = s1*a
            b1 = s2*b
            if((a1**5)==(x+b1**5)):
                print(a1,b1)
                isloop=False
                break
from math import atan, pi


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

if a * b / 2 * a <= x:
    res = (a ** 3) / (2 * ((a ** 2) * b - x))
else:
    res = 2 * x / (a * b * b)

res = atan(1 / res) / pi * 180
print(res)


### FIXED CODE ###

import math

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

if 2*x<=a*a*b:
    p1=a*b*b
    p2=2*x
else:
    p1=2*(a*a*b-x)
    p2=a*a*a

sit=math.atan(p1/p2)
print(math.degrees(sit))
n, q = map(int, input().split())
v = [set() for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].add(b)
  v[b].add(a)

for _ in range(q):
  p, x = map(int, input().split())
  c[p] += x

def addcount(p, prev):
  for i in v[p]:
    if i != prev:
      c[i] += c[p]
      addcount(i, p)
  return None
addcount(1, 0)
  
print(' '.join(str(i) for i in c[1:]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def input():
  return sys.stdin.readline()[:-1]

n, q = map(int, input().split())
v = [[] for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].append(b)
  v[b].append(a)

for _ in range(q):
  p, x = map(int, input().split())
  c[p] += x

def addcount(p, prev):
  for i in v[p]:
    if i != prev:
      c[i] += c[p]
      addcount(i, p)
  return None
addcount(1, 0)
  
print(*c[1:])
#(6,6)周期
#36種の希望

import numpy as np
N,K = map(int,input().split())
KK = 2*K
hope = np.zeros((KK,KK),dtype=np.int32)

XYC = [input().split() for _ in range(N)]

for _ in range(N):
  x,y,c  = input().split()
  x = int(x)
  y = int(y)
  if c == 'B':
    x -= K
  hope[x%KK,y%KK] += 1
# (x,y)を希望された場合、[x,x+K), [y,y+K)に終点があるべき
# 区間の重なってる枚数を集計。1,0,0,-1, cumsum
A = np.zeros((KK+K,KK+K),dtype=np.int32)
A[:-K,:-K] = hope[:]
A[K:,:-K] += -hope[:]
A[:-K,K:] += -hope[:]
A[K:,K:] += hope[:]
A = A.cumsum(axis = 0).cumsum(axis = 1)

# 実質同じ場所をまとめる
B = A[:,:KK]
B[:,:K] += A[:,KK:] #(3K,2K)
A = B[:KK,:]
A[:K,:] += B[KK:,:] #(2K,2K)
B = A[:K,:] #(K,2K)
B[:,:K] += A[K:,K:]
B[:,K:] += A[K:,:K]

answer = B.max()
print(answer)


### FIXED CODE ###

#(6,6)周期
#36種の希望

import numpy as np
N,K = map(int,input().split())
KK = 2*K
hope = np.zeros((KK,KK),dtype=np.int32)

XYC = [input().split() for _ in range(N)]

for x,y,c in XYC:
  x = int(x)
  y = int(y)
  if c == 'B':
    x -= K
  x %= KK
  y %= KK
  hope[x,y] += 1
# (x,y)を希望された場合、[x,x+K), [y,y+K)に終点があるべき
# 区間の重なってる枚数を集計。1,0,0,-1, cumsum
A = np.zeros((KK+K,KK+K),dtype=np.int32)
A[:-K,:-K] = hope[:]
A[K:,:-K] += -hope[:]
A[:-K,K:] += -hope[:]
A[K:,K:] += hope[:]
A = A.cumsum(axis = 0).cumsum(axis = 1)

# 実質同じ場所をまとめる
B = A[:,:KK]
B[:,:K] += A[:,KK:] #(3K,2K)
A = B[:KK,:]
A[:K,:] += B[KK:,:] #(2K,2K)
B = A[:K,:] #(K,2K)
B[:,:K] += A[K:,K:]
B[:,K:] += A[K:,:K]

answer = B.max()
print(answer)
from numpy import int64, divmod

N, A = open(0)
N, A = int(N), int64(A.split())

ans = 0
S = -1
while S:
    B, A = A % N, A // N
    S = B.sum()
    ans += S
    A += S - B

print(ans)


### FIXED CODE ###

N, *A = map(int, open(0).read().split())

ans = 0
S = 1
while S:
    S = sum(a // N for a in A)
    ans += S
    A = [a + S - (a // N) * (N + 1) for a in A]

print(ans)
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k = X:
        n += 1
print(n)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        n += 1
print(n)
import math
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
for i in range(n-1):
    f1=math.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
print(f2)

### FIXED CODE ###

import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
if n==1:
    print(check)
else:
    for i in range(n-1):
        f1=fractions.gcd(check,t[i+1])
        f2=check*t[i+1]//f1
        check=f2
    print(f2)
s = input()
ans = 0
for i in range(1,len(s)+1): #i文字の文字列について調べる
    for j in range(len(s)-1): #j文字目でスタートしたとして
        if all(s[k]=='A' or s[k]=='G' or s[k]=='C' or s[k]=='T' for k in range(j,j+i)):
            ans = i
print(ans)

### FIXED CODE ###

s = input()
ans = 0
for i in range(1,len(s)+1): #i文字の文字列について調べる
    for j in range(len(s)-i+1): #j文字目でスタートしたとして
        if all(s[k]=='A' or s[k]=='G' or s[k]=='C' or s[k]=='T' for k in range(j,j+i)):
            ans = i
print(ans)
n = int(input())
A = [int(input()) for i in range(n)] 
 
counter = [0]*max(A)
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c % 2 == 0 & c != 0:
        cnt += 1
print(cnt)

### FIXED CODE ###

n = int(input())
A = [int(input()) for i in range(n)]

b = set()
lenB = 0
for a in A:
    b.add(a)
    lenB += 1
    if len(b) != lenB:
        b.remove(a)
        lenB -= 2
print(len(b))
w,h,x,y = map(int,input().split())
if x == w/2 and y = h/2:
  flag = 1
else:
  flag = 0
print(h*w/2,flag)

### FIXED CODE ###

w,h,x,y = map(int,input().split())
if x == w/2 and y == h/2:
  flag = 1
else:
  flag = 0
print(h*w/2,flag)
def count(b, total, N):
    remain = N%total
    if remain < b:
        return remain
    else:
		return b

data = input()
N, b, r = [int(i) for i in data.split()]

ball = int(N/total) * b + count(b, b+r, N)
print(ball)

### FIXED CODE ###

def count(b, total, N):
  r = N%total
  if r < b:
    return r
  else:
    return b

data = input()
N, b, r = [int(i) for i in data.split()]

total = b + r

ball = int(N/total) * b + count(b, total, N)
print(ball)
L,N = map(int, input().split())
list=[]
for i in range(N):
  list.append(input())

print(''.join(sorted(list))

### FIXED CODE ###

N, L = map(int, input().split())
lists = []
for i in range(N):
    lists.append(input())

lists.sort()
print(''.join(lists))
N, K = [int(i) for i in input().split()]
ds = [int(i) for i in input().split()]

#N, K = (99999, 8)
#ds = [0,1,2,3,4,5,6,7,9]

def run_code(N, K, ds):

    dislike_digits_set = set(i for i in ds)
    avail_digits = [i for i in range(10) if i not in dislike_digits_set]
    avail_min = avail_digits[0]

    def get_next_digit(d):
        last = 10
        for ad in (avail_digits + [last]):
            if ad >= d:
                if ad == last:
                    return (1, avail_min)
                else:
                    return (0, ad)

    def to_num(n_digits):
        num = 0
        n = len(n_digits)
        for i in range(n):
            num += n_digits[i] * 10**(n-i-1)
        return num

    def to_digits(num):
        return [int(i) for i in str(num)]

    def search_nearest_larger(num):
        n_digits = to_digits(num)
        n = len(n_digits)

        for i in range(n):
            d_in = n_digits[i]
            inc, d_out = get_next_digit(d_in)
            if inc == 0 and d_in == d_out:
                continue
            if inc > 0:
                num += 10**(n-i)
                return search_nearest_larger(num)
            else:
                n_digits[i] = d_out
                return to_num(n_digits[:i+1] + [avail_min]*(n-i-1))

        return to_num(n_digits)

    return search_nearest_larger(N)



res = run_code(N, K, ds)
print(res)


### FIXED CODE ###

def run_code(N, K, ds):

    dislike_digits_set = set(i for i in ds)
    avail_digits = [i for i in range(10) if i not in dislike_digits_set]
    avail_min = avail_digits[0]

    def get_next_digit(d):
        last = 10
        for ad in (avail_digits + [last]):
            if ad >= d:
                if ad == last:
                    return (1, avail_min)
                else:
                    return (0, ad)

    def fill_last_kth_digits(n_digits, d, k):
        n = len(n_digits)
        for i in range(k):
            n_digits[n - i - 1] = d
        return n_digits

    def to_num(n_digits):
        num = 0
        n = len(n_digits)
        for i in range(n):
            num += n_digits[i] * 10**(n-i-1)
        return num

    def to_digits(num):
        return [int(i) for i in str(num)]

    def search_nearest_larger(num):
        n_digits = to_digits(num)
        n = len(n_digits)

        for i in range(n):
            d_in = n_digits[i]
            inc, d_out = get_next_digit(d_in)
            if inc == 0 and d_in == d_out:
                continue
            if inc > 0:
                num += 10**(n-i)
                n_digits = fill_last_kth_digits(to_digits(num), avail_min, n-i)
                return search_nearest_larger(to_num(n_digits))
            else:
                n_digits[i] = d_out
                return to_num(fill_last_kth_digits(n_digits, avail_min, n-i-1))

        return to_num(n_digits)

    return search_nearest_larger(N)


N, K = [int(i) for i in input().split()]
ds = [int(i) for i in input().split()]
res = run_code(N, K, ds)
print(res)
n = int(input())
return 0 if n == 1 else n

### FIXED CODE ###

n = int(input())
print(0 if n == 1 else 1)
def calc(x,y):
    i = len(x)
    j = len(y)
    if not d[i][j] == None:
        return d[i][j]
    else:
        if x[-1] == y[-1]:
            tmp = calc(x[:-1],y[:-1])+1
            d[i][j] = tmp
            return tmp
        else:
            tmp = max(calc(x[:-1],y),calc(x,y[:-1]))
            d[i][j] = tmp
            return tmp
        
q = int(input())
for i in range(q):
    x = input()
    y = input()
    d = [[0 if i == 0 or j == 0 else None for i in range(len(y)+1)] for j in range(len(x)+1)]
    print(calc(x,y))


### FIXED CODE ###

def calc(x,y):
    n = len(x)
    m = len(y)
    dp1 = [0]*(m+1)
    for i in range(n):
        s = x[i]
        dp2 = dp1[:]
        for j in range(m):
            if s == y[j]:
                dp1[j+1] = dp2[j]+1
            elif dp1[j+1] < dp1[j]:
                dp1[j+1] = dp1[j]
    return dp1[-1]

q = int(input())
for i in range(q):
    x = input()
    y = input()
    print(calc(x,y))
W,H,x,y,r = map(int,input().split())

w,h = W-r,h=r

if x<0 and w<x and y<0 and h<y: print('No')

else: print('Yes')



### FIXED CODE ###

W,H,x,y,r = map(int,input().split())



if x-r<0 or W<x+r or y-r<0 or H<y+r: print('No')

else: print('Yes')
S = input().strip()

T = "keyence"

count = 0
j = 0
is_last = False
for i in range(0,len(S)):
    if count == 0 and T[j] == S[i]:
        j += 1
        continue
    elif count > 0 and T[j] == S[i]:
        is_last = True
        j += 1
    elif is_last and T[j] != S[i]:
        print("NO")
        exit()
    elif T[j] != S[i]:
        count += 1

if j == len(T):
    print("YES")
else:
    print("NO")






### FIXED CODE ###

S = input().strip()

T = "keyence"

if S.startswith(T) or S.endswith(T):
    print("YES")
    exit()

count = 0
j = 0
is_last = False
for i in range(0,len(S)):
    if j >= len(T):
        print("NO")
        exit()
    if T[j] == S[i]:
        j += 1
        continue
    elif T[j] != S[i]:
        print("YES" if S.endswith(T[j:]) else "NO")
        exit()

if j == len(T):
    print("YES")
else:
    print("NO")
import math
import copy
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n1 = int(input())
nl1 = [int(i1) for i1 in input().split()]

r1 = 0
for  i2 in range(n1):
    nl2 = copy.copy(nl1)
    if i2 == 0:
        nl2[i2] = nl1[1]
    else:
        nl2[i2] = nl1[i2 - 1]
    r1 = max(r1,gcd_list(nl2))

print(str(r1))

### FIXED CODE ###

import fractions
import sys

n1 = int(input())
nl1 = [int(i1) for i1 in input().split()]

if n1 == 2:
    print(max(nl1))
    sys.exit()

r1 = 0

nl1.sort()

if n1 >= 3:
    n2 = fractions.gcd(nl1[0], nl1[1]) 
    n2 = max(n2, fractions.gcd(nl1[1], nl1[2]))
    n2 = max(n2, fractions.gcd(nl1[0], nl1[2]))

c1 = 0
for i2 in range(n1):
    if nl1[i2] % n2 != 0:
        c1 += 1
    if c1 >= 2:
        break
    if i2 == (n1 - 1):
        r1 = n2

i3 = n2

while r1 == 0:
    c1 = 0
    for i4 in range(n1):
        if nl1[i4] % i3 != 0:
            c1 += 1
        if c1 >= 2:
            break
        if i4 == (n1 - 1):
            r1 = i3
    i3 -= 1

print(str(r1))
N = int(input().strip())

X = {}
Y = {}
G = (X, Y)

for _ in range(N):
  x, y = map(int, input().strip().split())
  if x not in X: X[x] = []
  if y not in Y: Y[y] = []
  X[x].append(y)
  Y[y].append(x)


def dfs_visit(visited, u, i):
  if u in visited[i]: return
  visited[i].add(u)
  for v in G[i][u]: dfs_visit(visited, v, (i + 1) % 2)


count = 0
while len(X) > 0:
  visited = (set(), set())
  x = X.__iter__().__next__()
  dfs_visit(visited, x, 0)

  for x in visited[0]:
    count += len(visited[1]) - len(X.pop(x))

print(count)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N = int(input().strip())

X = {}
Y = {}
G = (X, Y)

for _ in range(N):
  x, y = map(int, input().strip().split())
  if x not in X: X[x] = []
  if y not in Y: Y[y] = []
  X[x].append(y)
  Y[y].append(x)


def dfs_visit(visited, u, i):
  if u in visited[i]: return
  visited[i].add(u)
  for v in G[i][u]:
    dfs_visit(visited, v, (i + 1) % 2)


count = 0
i = 0
while len(X) > 0:
  visited = (set(), set())
  x = X.__iter__().__next__()
  dfs_visit(visited, x, 0)

  for x in visited[0]:
    count += len(visited[1]) - len(X.pop(x))

print(count)
n=int(input())
a=list(map(int,input().split()))
a.sort()
CNT=[]
for i in range(n-1):
  cnt=0
  for j in range(n-i):
    if abs(a[i+j]-a[i])<2:
      cnt+=1
    else:
      CNT.append(cnt)
      break
print(max(CNT))

  

### FIXED CODE ###

import collections
import sys
n=int(input())
a=list(map(int,input().split()))
b=list(collections.Counter(a).items())
b.sort(key=lambda x:int(x[0]))
if len(b)==1:
  print(n)
  sys.exit()
lst=[]
num=b[0][1]
if int(b[1][0])-int(b[0][0])==1:
  num+=b[1][1]
lst.append(num)
for i in range(1,len(b)-1):
  num=b[i][1]
  if int(b[i+1][0])-int(b[i][0])==1:
    num+=b[i+1][1]
  if int(b[i][0])-int(b[i-1][0])==1:
    num+=b[i-1][1]
  lst.append(num)
num=b[len(b)-1][1]
if int(b[len(b)-1][0])-int(b[len(b)-2][0])==1:
  num+=b[len(b)-2][1]
lst.append(num)
print(max(lst))