Harryxun/stf_run huggingface dataset:
h,w=map(int, input().split()) 
s=[list(input()) for i in range(w)] 

s1=[['.' for i in range(h+2)] for i in range(w+2)]

for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            s1[i+1][j+1]='#'
for i in range(h+2):
    for j in range(w+2):
        if s1[i][j]=='#':
            if s1[i-1][j]==s1[i+1][j]==s1[i][j-1]==s1[i][j+1]=='.':
                print('No')
                exit()
print('Yes')

### FIXED CODE ###

h,w=map(int, input().split()) 
s=[list(input()) for i in range(h)] 

s1=[['.' for i in range(w+2)] for i in range(h+2)]

for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            s1[i+1][j+1]='#'
for i in range(h+2):
    for j in range(w+2):
        if s1[i][j]=='#':
            if s1[i-1][j]==s1[i+1][j]==s1[i][j-1]==s1[i][j+1]=='.':
                print('No')
                exit()
print('Yes')
import math

x1,y1,x2,y2 = raw_input().split(' ')

line = math.sqrt((int(x2)-int(x1)**2)+((int(y2)-int(y1))**2))

print line

### FIXED CODE ###

import math

x1,y1,x2,y2 = raw_input().split()

tei  = float(x2) - float(x1)
taka = float(y2) - float(y1)

if tei == taka:
    st = math.sqrt(2)
    answ = st * tei
    print answ
if tei != taka:
    answ = (tei*tei) + (taka*taka)
    print math.sqrt(answ)
K,S=map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0<=S-x-y<=K:
            count=count+1
print(count)

### FIXED CODE ###

#51
Haiku = str(input())
print(Haiku.replace(","," "))
n = map(int, input().split())
i = 3

if n[0] == n[1] :
    i -= 1

if n[0] == n[2] :
    i -= 1

elif n[1] == n[2] :
    i -= 1

print(i)


### FIXED CODE ###

n = list(map(int, input().split()))
i = 3

if n[0] == n[1] :
    i -= 1

if n[0] == n[2] :
    i -= 1

elif n[1] == n[2] :
    i -= 1

print(i)
S = int(input())
s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print([0][1][2].format(h,m,s))

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(h,':',m,":",s , sep ="")
#print("{a}:{b}:{c}".format(h,m,s))
n =int(input())
a = [int(i) for i in input().split()]
is_same = False

for i in range(n):
    for j in range(i+1, n+1):
        if a[i] == a[j]:
            is_same = True

if is_same:
    print('NO')
else:
    print('YES')

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

a.sort()

for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        break
else:
    print('YES')
N=int(input())
d=list(map(int,input().split()))
count=1
if d[0]!=0:
    count=0
for i in range(max(d)):
    count *= pow(i+1,d.count(i+1),99844353)
print(count)


### FIXED CODE ###

N=int(input())
if N % 2==0:
    print(N//2-1)
else:
    print(N//2)
n=int(input())
dat = list(map(int, input().split()))

for e in dat:
    e = str(bin(e))

for e in dat:
    e = e[1]

#print(min(dat)-1)



### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
def inp():
    return(int(input()))
  
i = inp()
D = i[0]
T = i[1]
S = i[2]

if D/T > S:
	print("No")
else print("Yes")

### FIXED CODE ###

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i = inlt()
D = i[0]
T = i[1]
S = i[2]
 
if D/T > S:
  print("No")
else:
  print("Yes")
N = int(input())

A = tuple( map(int, input().split()) )

dict_ = {}

ans = 0
for i in range(N):
  k = (i+1) - A[i]
  if k in dict_:
    ans += dict[k]
  ad = (i+1) + A[i]
  if ad in dict_:
    dict_[ad] = dict_[ad] + 1
  dict_[ad] = 1

print(ans)

### FIXED CODE ###

N = int(input())

A = tuple( map(int, input().split()) )

dict_ = {}

ans = 0
for i in range(N):
  k = (i+1) - A[i]
  if k in dict_:
    ans += dict_[k]
  ad = (i+1) + A[i]
  if ad in dict_:
    dict_[ad] = dict_[ad] + 1
  else:
    dict_[ad] = 1

print(ans)
n, y = map(int, input().split())
for i in range(0, n+1):
    for j in range(0, n+1-i):
    	if 10000*i+5000*j+1000*(n-i-j) == y:
    			print(i, j, n-i-j)
    		else:
    			print(-1, -1, -1)

### FIXED CODE ###

n, y = map(int, input().split())
ans = (-1, -1, -1)
for i in range(0, n+1):
    for j in range(0, n+1-i):
    	if 10000*i+5000*j+1000*(n-i-j) == y:
    		ans = (i, j, n-i-j)
print(ans[0], ans[1], ans[2])
IN = iter(Input.split('\n')).__next__
def input():
    return IN()

###################################################
from collections import defaultdict


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


def divisor(n):
    div_list = []
    limit = int(n**0.5) + 1
    for div in range(1, limit):
        if n % div == 0:
            div2 = n // div
            div_list.append(div)
            if div != div2:
                div_list.append(div2)
    
    return div_list


        
A_dict = defaultdict(int)
for a in A:
    A_dict[a] += 1

    
ans = n
for a in A:
    divs = divisor(a)
    for div in divs:
        if div == a:
            
            if A_dict[div] >= 2:
                ans -= 1
                break
        else:
            if A_dict[div] >= 1:
                ans -= 1
                break
            

print(ans)

### FIXED CODE ###

import numpy as np
from collections import Counter


n = int(input())
A = list(map(int, input().split()))
A.sort()
is_divisible = np.zeros(10**6+1, dtype=np.int64)


def update(num):
    nums = np.arange(num, 10**6+1, num)
    is_divisible[nums] = True

counter = Counter(A)
ans = 0
for a, count in counter.items():
    if count == 1 and not is_divisible[a]:
        ans += 1
        
    update(a)

print(ans)
n=int(input())
x=["pon","pon","hon","bon","hon","hon","pon","hon","pon","hon"]
print(x[n//10])

### FIXED CODE ###

n=int(input())
x=["pon","pon","hon","bon","hon","hon","pon","hon","pon","hon"]
print(x[n%10])
import queue
K = int(intut())
q = queue.Queue()
for i in range(9):
  q.put(i + 1)
for i in range(K):
  tmp = q.get()
  if tmp % 10 == 0:
    q.put(10 * tmp)
    q.put(10 * tmp + 1)
  elif tmp % 10 == 9:
    q.put(10 * tmp + 8)
    q.put(10 * tmp + 9)
  else:
    for t in range(-1,2):
      q.put(10 * tmp + tmp % 10 + t)
print(tmp)

### FIXED CODE ###

import queue
K = int(input())
q = queue.Queue()
count = 0
for i in range(1,10):
  q.put(str(i))
while count < K:
  tmp = q.get()
  count += 1
  if count == K:
    print(tmp)
    break
  if tmp[-1] == '0':
    for add in ['0', '1']:
      q.put(tmp + add)
  elif tmp[-1] == '9':
    for add in ['8', '9']:
      q.put(tmp + add)
  else:
    for add in [str(int(tmp[-1]) - 1),tmp[-1], str(int(tmp[-1]) + 1)]:
      q.put(tmp + add)
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


n,k=list(map(int,input().split()))
r=n-k
for i in range(1,k+1):
    if(k-i>=0 and r-(i-1)>=0):
        p=tyou(i,k-i)*tyou(i+1,r-(i-1))
        ans=p%(10**9+7)
        print(ans)

### FIXED CODE ###

def comb(n, r):
    if n == 0 or r == 0:
        return 1
    if n < r:
        return 0
    a = b = 1
    r = min(n-r, r)
    for i in range(n-r+1,n+1):
        a*=i
    for i in range(1,r+1):
        b*=i
    
    return a//b
 
N, K = map(int, input().split())
MOD = int(1e9)+7
 
for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))
N=int(input())
a=[0]*(N-1)
b=[0]*(N-1)
c=[0]*(N-1)
d=[[] for _ in range(N)] # 接続
e=[ set() for _ in range(N)] #その頂点につながる辺に存在する色のリスト
maxi=0
for i in range(N-1):
    a[i],b[i] = map(int,input().split())
    d[a[i]-1].append(b[i]-1)
    d[b[i]-1].append(a[i]-1)
    
for j in d:
    maxi=max(maxi,len(j))  #最大の色数が確定する
for i in range(N-1):
    pos=set([i+1 for i in range(maxi)])
    pos= pos- e[a[i]-1] -e[b[i]-1]
    col=min(pos)
    c[i]=col
    e[a[i]-1].add(col)
    e[b[i]-1].add(col)
   
print(maxi)
for color in c:
    print(color)


### FIXED CODE ###

from collections import deque

N=int(input())
a=[0]*(N-1)
b=[0]*(N-1)
c=[set() for _ in range(N)] # 使用している色
d=[set() for _ in range(N)] # 隣接リスト
e=[ False for _ in range(N)] #訪問ずみかどうか
f=[0]*N  #答え
for i in range(N-1):
    a[i],b[i] = map(int,input().split())
    d[a[i]-1].add(b[i]-1)
    d[b[i]-1].add(a[i]-1)

maxi=max([len(d[i]) for i in range(N-1)])
print(maxi)
#print("c:",c)
#print("d",d)
#print("e",e)

#x=0としてBFSする

v=deque([0])
e[0]=True
color=1

while v:
  p = v.popleft()
  for q in d[p]:
    if e[q]==False:
      while color in c[p]:
        color +=1
        if color>maxi:
          color=1
      c[p].add(color)
      c[q].add(color)
      f[q]=color
      e[q]=True
      v.append(q)
      
for i in range(N-1):
  print( f[b[i]-1])
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

N = int(input())
INF = 10**18

res = 0
dp = [INF]*(2*N)
dp[0] = 0
for i in range(0, N+1):
    dp[i+1] = min(dp[i+1], dp[i]+1)

    j = 1
    while i+(6**j) <= N:
        dp[i+(6**j)] = min(dp[i+(6**j)], dp[i] + 1)
        j += 1

    l = 1
    while i+(9**l) <= N:
        dp[i+(9**l)] = min(dp[i+9**l], dp[i] + 1)
        l += 1

print(dp[N])




### FIXED CODE ###

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

N = int(input())
INF = 10**18

res = 0
dp = [INF]*(10*N)
dp[0] = 0
for i in range(0, N):
    dp[i+1] = min(dp[i+1], dp[i]+1)

    j = 1
    while i+6**j <= N:
        dp[i+6**j] = min(dp[i+6**j], dp[i]+1)
        j += 1

    l = 1
    while i+9**l <= N:
        dp[i+9**l] = min(dp[i+9**l], dp[i]+1)
        l += 1

print(dp[N])
from fractions import gcd

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

#https://qiita.com/maebaru/items/317af98e85e9f4db04f9
def prime_numbers(m):
    # 素数を保持するset
    primes = set()

    # 2以上m以下の素数を数え上げる
    n = 2
    while n <= m:
        # 自身より小さい全ての素数で割り切れなければ、素数とみなせる
        if all(n % i != 0 for i in primes):
            primes.add(n)
        n += 1

    return list(primes)
    
#https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
def factorization(n,primes,primenum_count_for_lcm):
    temp = n
    for i in range(len(primes)):
        if temp%primes[i]==0:
            cnt=0
            while temp%primes[i]==0:
                cnt+=1
                temp //= primes[i]
            if primenum_count_for_lcm[i] < cnt:
                primenum_count_for_lcm[i] = cnt
        if temp < i:
            break

    if temp!=1:
        idx = primenum_count_for_lcm.index(temp())
        if primenum_count_for_lcm[idx] == 0:
            primenum_count_for_lcm[idx] = 1
            
    #if arr==[]:
    #    arr.append([n, 1])
    
    return primenum_count_for_lcm

primes = prime_numbers(int(10**3))
primes.sort()
primenum_count_for_lcm = [0]*len(primes)
for i in range(N):
    primenum_count_for_lcm = factorization(A[i],primes,primenum_count_for_lcm)

sugoilcm = 1
for i in range(len(primes)):
    sugoilcm *= primes[i]**primenum_count_for_lcm[i]

ans = 0
for i in range(N):
    ans += sugoilcm//A[i]
print(int(ans%(10**9+7)))


### FIXED CODE ###

import fractions

def main():
    mod = 10**9+7
    N = int(input())
    A = list(map(int,input().split()))
    lcm = 1
    for Ai in A:
        lcm = lcm*Ai//fractions.gcd(lcm,Ai)
    lcm %= mod
    ans = 0
    for Ai in A:
        ans += lcm*pow(Ai,mod-2,mod)%mod
        ans %= mod
    print(ans)
    
if __name__ == '__main__':
    main()
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
if n % 2 == 0:
    k = n // 2
else:
    k = (n // 2) + 1
a_1 = a[0:k-1]
a_2 = a[k-1:]
ans = - sum(a_1) + sum(a_2)
print(ans)
if n % 2 == 1:
    for i in range(n - 1):
        if i == 0:
            x = a_1.pop(0)            
            y = a_2.pop(0)
            print(str(x) + " " + str(y))
        else:
            if i % 2 == 0:
                y = x - y
                x = a_1.pop(0)
                print(str(x) + " " + str(y))
            elif i % 2 == 1:
                y = x - y
                x = a_2.pop(0)
                print(str(x) + " " + str(y))
elif n % 2 == 0:
    for i in range(n - 1):
        if i == 0:
            x = a_2.pop(0)
            y = a_1.pop(0)
            print(str(x) + " " + str(y))
        else:
            if i % 2 == 0:
                y = x - y
                x = a_2.pop(0)
                print(str(x) + " " + str(y))
            elif i % 2 == 1:
                y = x - y
                x = a_1.pop(0)
                print(str(x) + " " + str(y))

### FIXED CODE ###

import bisect
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
point = bisect.bisect_right(a, 0)
a_minus = a[:point]
a_plus = a[point:]
len_plus = len(a_plus)
if (len(a_minus) > 0) & (len(a_plus) > 0):
    ans = sum(a_plus) - sum(a_minus)
    print(ans)
    for i in range(len(a_plus)):
        if len_plus == 1:
            x = a_plus.pop(0)
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        elif (i == 0):
            x = a_minus.pop(0)
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 1:
            y = x - y
            x = a_plus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
    for j in range(len(a_minus)):
        x = x - y
        y = a_minus.pop(0)
        print(str(x) + ' ' + str(y))
elif len(a_plus) > 0:
    ans = sum(a_plus) - ((a[0]) * 2)
    print(ans)
    for i in range(len(a_plus) - 1):
        if i == 0:
            x = a_plus.pop(0)
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 2:
            y = x - y
            x = a_plus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
elif len(a_minus) > 0:
    ans = (a_minus[-1] * 2) - sum(a_minus)
    print(ans)
    for i in range(len(a_minus) - 1):
        if i == 0:
            x = a_minus[-1]
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 2:
            x = x - y
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
vN = input()
n = int(N)
s = sum([int(i) for i in list(N)])
if n % s == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = input()
n = int(N)
s = sum([int(i) for i in list(N)])
if n % s == 0:
    print("Yes")
else:
    print("No")
n, w = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(n)]
if w < items[0][0] :
    print(0)
    exit()
w_sum = 0
v_sum = 0
for i in range(n):
    w_sum += items[i][0]
    v_sum += items[i][1]
if w >= w_sum:
    print(v_sum)
    exit()
dp = {}
#for j in range(items[0][0],w+1):
cnt_l = 1
cnt_r = 0
j = items[0][0] * cnt_l + cnt_r
while j < w+1:
    for i in range(1,n+1):
        if j-items[i-1][0] >= 0:
            if str(i-1)+":"+str(j) not in dp:
                dp[str(i - 1) + ":" + str(j)] = 0
            if str(i-1)+":"+str(j-items[i-1][0]) not in dp:
                dp[str(i - 1) + ":" + str(j - items[i - 1][0])] = 0
            dp[str(i)+":"+str(j)] = max(dp[str(i-1)+":"+str(j)],dp[str(i-1)+":"+str(j-items[i-1][0])]+items[i-1][1])
        else:
            if str(i-1)+":"+str(j) not in dp:
                dp[str(i - 1) + ":" + str(j)] = 0
            dp[str(i)+":"+str(j)] = dp[str(i-1)+":"+str(j)]
    cnt_r += 1
    if cnt_r >= 350:
        cnt_l += 1
        cnt_r = 0
    j = items[0][0] * cnt_l + cnt_r
print(dp[str(n)+":"+str(w)])

### FIXED CODE ###

N,W=map(int,input().split())
dp=[[-1]*301 for i in range(N+1)]
dp[0][0]=0

for i in range(N):
    w,v=map(int,input().split())
    if i==0:
        base=w
    for i in range(N)[::-1]:
        for j in range(301)[::-1]:
            if dp[i][j]!=-1:
                dp[i+1][j+w-base]=max(dp[i][j]+v,dp[i+1][j+w-base])

ans=0
for index,item in enumerate(dp):
    if W-index*base+1<=0:
        break
    ans=max(max(item[:W-index*base+1]),ans)

print(ans)
n = int(input())
a = list(map(int, input().split()))
c = 0
for idx, i in enumerate(a):
  if idx %2 ==0:
    c += i
  else: 
    c -= i
x1 = c/2
print(x1)
for i in range(1,N):
  x1 = 2*a[i] - x1
  print(x1)


### FIXED CODE ###

import numpy as np

n = map(int, raw_input().split())

x = map(int, raw_input().split())
n = n[0]
ans = []

x = np.asarray(x)
double_x = 2 * x
x0 = 0
multiple = 1
for j in range(n):
    x0 += x[j] * multiple
    multiple *= -1
ans.append(x0)
for i in range(0, n-1):
    ans.append(double_x[i] - ans[i])

print ' '.join(map(str, ans))
import numpy as np


h,w,m = map(int,input().split())
yp = np.zeros((h,2),dtype=np.int)
yp[:,1] = np.arange(h)
xp = np.zeros((w,2),dtype=np.int)
xp[:,1] = np.arange(w)

b = np.zeros((h,w),dtype=np.bool)


for i in range(m):
    hi,wi = map(int,input().split())
    b[hi-1,wi-1] += 1
    yp[hi-1,0] += 1
    xp[wi-1,0] += 1
yps = np.argsort(yp[:,0])[::-1]
ypmax = yp[yps[0]]
#print(ypmax)
#print(b)
ans = 0
for i in range(h):
    a = xp[i,0]+ypmax[0]
    if b[yps[0],i] == 1:
        a -= 1
    ans = max(ans,a)
print(ans)

### FIXED CODE ###

from random import randint
import numpy as np
from numba import njit


#@njit
def f(h,w,m,ins):
    yp = np.zeros((h,2),dtype=np.int)
    xp = np.zeros((w,2),dtype=np.int)
    yp[:,1] = np.arange(h)
    xp[:,1] = np.arange(w)
    ans = 0
    s = set()
    for hi,wi in ins:
        s.add((hi-1,wi-1))
        yp[hi-1,0] += 1
        xp[wi-1,0] += 1
    ypm = yp[:,0].max()
    xpm = xp[:,0].max()
    yps = yp[yp[:,0] == ypm][:,1]
    xps = xp[xp[:,0] == xpm][:,1]
    #y = yp[yps]
    for ypsi in yps:
        for xpsi in xps:
            a = yp[ypsi,0]+xp[xpsi,0]
            if (ypsi,xpsi) in s:
                a -= 1
                ans = max(ans,a)
            else:
                return a
    return ans


if False:
    while True:
        h,w = randint(1,10**5*3),randint(1,10**5*3)
        m = randint(1,min(h*w,10**5*3))
        ins = [(randint(1,h),randint(1,w)) for i in range(m)]
        ans1 = f1(h,w,m,ins)
        ans2 = f2(h,w,m,ins)
        if ans1 != ans2:
            print("!!!!")
            print(h,w,m)
            print(ins)
else:
    h,w,m = map(int,input().split())
    ans = f(h,w,m,[tuple(map(int,input().split())) for i in range(m)])
    print(ans)
解説放送の１つめ
N,M = map(int, input().split())
A = list(map(int, input().split()))
f = [-1, 2,5,5,4,5,6,3,7,6] # 1-indexed
 
# dp[i]: マッチi本数で作れる最大の数(str)
dp = [None]*(N+1)
dp[0] = ""
 
# strの数の大きいほう
def max_str(s1:str, s2:str)->str:
    """return bigger one"""
    l1, l2 = len(s1), len(s2)
    if l1 != l2:
        return s1 if l1>l2 else s2
    if l1 == l2: 
        return s1 if s1>s2 else s2
    
for i in range(2, N+1):
    nxt = ""
    for aj in A:
        # 配列外参照と，i本ちょうどで作れないものはだめ
        if i-f[aj]<0 or dp[i-f[aj]]==None: continue
        nxt = max_str(nxt, 
                      dp[i-f[aj]]+str(aj))
    if nxt!="":
        dp[i] = nxt
    #print(dp)
print(dp[N])

### FIXED CODE ###

# 解説放送の１つめ
N,M = map(int, input().split())
A = list(map(int, input().split()))
f = [-1, 2,5,5,4,5,6,3,7,6] # 1-indexed

# dp[i]: マッチi本数で作れる最大の数(str)
dp = [None]*(N+1)
dp[0] = ""

# strの数の大きいほう
def max_str(s1:str, s2:str)->str:
    """return bigger one"""
    l1, l2 = len(s1), len(s2)
    if l1 != l2:
        return s1 if l1>l2 else s2
    if l1 == l2: 
        return s1 if s1>s2 else s2
    
for i in range(2, N+1):
    nxt = ""
    for aj in A:
        # 配列外参照と，i本ちょうどで作れないものはだめ
        if i-f[aj]<0 or dp[i-f[aj]]==None: continue
        nxt = max_str(nxt, 
                      dp[i-f[aj]]+str(aj))
    if nxt!="":
        dp[i] = nxt
    #print(dp)
print(dp[N])
S = input()

def res(S, A, B):
    if not S:
        B.append(sum(list(map(int, A))))
        return None
    A += [S[0]]
    res(S[1:], A, B)
    A.pop()
    A[-1] += S[0]
    res(S[1:], A, B)
    return B

B = res(S[1:], [S[0]], [])
print(sum(B))

### FIXED CODE ###

from sys import setrecursionlimit; setrecursionlimit(10**9)
S = input()

def res(S, A, B):
    if not S:
        B.append(sum(list(map(int, A))))
        return None
    A += [S[0]]
    res(S[1:], A, B)
    A.pop()
    A[-1] += S[0]
    res(S[1:], A, B)
    return B

if len(S) == 1:
    print(int(S))
else:
    B = res(S[1:], [S[0]], [])
    print(sum(B))
import math

def kanashimi(b):
    
    out = 0
    for i in range(N):
        out = out + abs(A[i]-(b+(i+1)))
    return out 
ans = 10**20
for i in range(-100,100):
    ans = min(ans,kanashimi(i))
print(ans)

### FIXED CODE ###

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


import statistics
import math
def kanashimi(b):
    
    out = 0
    for i in range(N):
        out = out + abs(A[i]-(b+(i+1)))
    return out 
  
B = [A[i]-(i+1) for i in range(N)]
b = statistics.median(B)

print(int(kanashimi(b)))
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


#mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

from scipy.optimize import fmin



def main():
	n = int(input())
	xy = [list(map(int, input().split())) for _ in [0] * n]
	def calc(k):
		i, j = k
		ans = 0
		for x, y in xy:
			ans = max(ans, (x - i) ** 2 + (y - j) ** 2)
		return ans

	x, y = fmin(calc, [500, 500], disp=0)
	print(calc((x, y)) ** 0.5)



if __name__ == "__main__":
	main()


### FIXED CODE ###

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


#mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np


def main():
	n=int(input())
	x=[]
	y=[]
	for _ in range(n):
		xin,yin=map(int,input().split())
		x.append(xin)
		y.append(yin)
	
	li=[[0]*n for _ in range(n)]
	
	for i in range(n):
		for j in range(n):
			if i>j:
				li[i][j]=((x[i]+x[j])/2,(y[i]+y[j])/2,(((x[j]-x[i])**2)+(y[j]-y[i])**2)**0.5)
				li[j][i]=(-(y[j]-y[i]),(x[j]-x[i]))
	l=0
	h=1000
	
	
	for ii in range(100):
		m=(l+h)/2
		ko=[]
		for i in range(n):
			for j in range(n):
				if i>j:
					k=4*(m**2)-(li[i][j][2])**2
					if k>0:
						k=k/(4*(li[i][j][2])**2)
						k=k**0.5
						ko.append((li[i][j][0]+k*li[j][i][0],li[i][j][1]+k*li[j][i][1]))
						ko.append((li[i][j][0] - k * li[j][i][0], li[i][j][1] - k * li[j][i][1]))
		if len(ko)==0:
			l=m
			continue
		
		for point in ko:
			f=0
			for i in range(n):
				length=((point[0]-x[i])**2+(point[1]-y[i])**2)**0.5
				if length-0.0000000000001>m:
					f=1
					break
			if f==0:
				h=m
				break
		else:
			l=m
		
		
	print(l)
	
		
		
		
		
		
		
		
		
		
	
	
	
	
	
	
	
	


if __name__ == "__main__":
	main()