Problem:
 Score : 600 points    Problem Statement Given are N points (x_i, y_i) in a two-dimensional plane.  Find the minimum radius of a circle such that all the points are inside or on it.      Constraints  2 \leq N \leq 50  0 \leq x_i \leq 1000  0 \leq y_i \leq 1000  The given N points are all different.  The values in input are all integers.         Input Input is given from Standard Input in the following format:  N  x_1  y_1  :  x_N  y_N       Output Print the minimum radius of a circle such that all the N points are inside or on it.  Your output will be considered correct if the absolute or relative error from our answer is at most 10^{-6} .        Sample Input 1 2
0 0
1 0      Sample Output 1 0.500000000000000000  Both points are contained in the circle centered at (0.5,0) with a radius of 0.5 .       Sample Input 2 3
0 0
0 1
1 0      Sample Output 2 0.707106781186497524       Sample Input 3 10
10 9
5 9
2 0
0 0
2 7
3 3
2 5
10 0
3 7
1 9      Sample Output 3 6.726812023536805158  If the absolute or relative error from our answer is at most 10^{-6} , the output will be considered correct.

Solution (Python):
import random
import math

def make_circle(points):
	
	shuffled = [(float(x), float(y)) for (x, y) in points]
	random.shuffle(shuffled)
	
	
	c = None
	for (i, p) in enumerate(shuffled):
		if c is None or not is_in_circle(c, p):
			c = _make_circle_one_point(shuffled[ : i + 1], p)
	return c



def _make_circle_one_point(points, p):
	c = (p[0], p[1], 0.0)
	for (i, q) in enumerate(points):
		if not is_in_circle(c, q):
			if c[2] == 0.0:
				c = make_diameter(p, q)
			else:
				c = _make_circle_two_points(points[ : i + 1], p, q)
	return c



def _make_circle_two_points(points, p, q):
	circ = make_diameter(p, q)
	left  = None
	right = None
	px, py = p
	qx, qy = q
	
	
	for r in points:
		if is_in_circle(circ, r):
			continue
		
		
		cross = _cross_product(px, py, qx, qy, r[0], r[1])
		c = make_circumcircle(p, q, r)
		if c is None:
			continue
		elif cross > 0.0 and (left is None or _cross_product(px, py, qx, qy, c[0], c[1]) > _cross_product(px, py, qx, qy, left[0], left[1])):
			left = c
		elif cross < 0.0 and (right is None or _cross_product(px, py, qx, qy, c[0], c[1]) < _cross_product(px, py, qx, qy, right[0], right[1])):
			right = c
	
	
	if left is None and right is None:
		return circ
	elif left is None:
		return right
	elif right is None:
		return left
	else:
		return left if (left[2] <= right[2]) else right


def make_diameter(a, b):
	cx = (a[0] + b[0]) / 2.0
	cy = (a[1] + b[1]) / 2.0
	r0 = math.hypot(cx - a[0], cy - a[1])
	r1 = math.hypot(cx - b[0], cy - b[1])
	return (cx, cy, max(r0, r1))


def make_circumcircle(a, b, c):
	
	ox = (min(a[0], b[0], c[0]) + max(a[0], b[0], c[0])) / 2.0
	oy = (min(a[1], b[1], c[1]) + max(a[1], b[1], c[1])) / 2.0
	ax = a[0] - ox;  ay = a[1] - oy
	bx = b[0] - ox;  by = b[1] - oy
	cx = c[0] - ox;  cy = c[1] - oy
	d = (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)) * 2.0
	if d == 0.0:
		return None
	x = ox + ((ax*ax + ay*ay) * (by - cy) + (bx*bx + by*by) * (cy - ay) + (cx*cx + cy*cy) * (ay - by)) / d
	y = oy + ((ax*ax + ay*ay) * (cx - bx) + (bx*bx + by*by) * (ax - cx) + (cx*cx + cy*cy) * (bx - ax)) / d
	ra = math.hypot(x - a[0], y - a[1])
	rb = math.hypot(x - b[0], y - b[1])
	rc = math.hypot(x - c[0], y - c[1])
	return (x, y, max(ra, rb, rc))


_MULTIPLICATIVE_EPSILON = 1 + 1e-14

def is_in_circle(c, p):
	return c is not None and math.hypot(p[0] - c[0], p[1] - c[1]) <= c[2] * _MULTIPLICATIVE_EPSILON



def _cross_product(x0, y0, x1, y1, x2, y2):
	return (x1 - x0) * (y2 - y0) - (y1 - y0) * (x2 - x0)
  
n = int(input())
points = [list(map(int, input().split())) for _ in range(n)]
print(make_circle(points)[2])

Solution (Python):
def solve():
    from sys import stdin
    f_i = stdin
    
    N = int(f_i.readline())
    
    points = []
    for i in range(N):
        x, y = map(int, f_i.readline().split())
        points.append(x + y * 1j)
    
    from itertools import combinations
    radiuses = []
    
    for p1, p2 in combinations(points, 2):
        c = (p1 + p2) / 2
        r = abs(p1 - c)
        for p in points:
            if abs(p - c) > r:
                break
        else:
            radiuses.append(r)
    
    if radiuses:
        return min(radiuses)
    
    def circumcircle(a, b, c):
        n = (a - b) * abs(c) ** 2 + (b - c) * abs(a) ** 2 + (c - a) * abs(b) ** 2
        d = (a - b) * c.conjugate() + (b - c) * a.conjugate() + (c - a) * b.conjugate()
        return n / d 
    
    err = 10 ** -7
    for p1, p2, p3 in combinations(points, 3):
        z1 = p3 - p1
        z2 = p2 - p1
        if z1.real * z2.imag == z1.imag * z2.real:
            continue
        
        c = circumcircle(p1, p2, p3)
        r = abs(p1 - c)
        for p in points:
            
            if abs(p - c) - r > err:
                break
        else:
            radiuses.append(r)
    
    return min(radiuses)

print(solve())

Solution (Python):
def examA():
    C = SI()
    ans = chr(ord(C)+1)
    print(ans)
    return

def examB():
    N,K,M = LI()
    A = LI()
    ans = N*M-sum(A)
    if ans>K:
        ans = -1
    elif ans<0:
        ans = 0
    print(ans)
    return

def examC():
    N, M = LI()
    ansT = 0; ansP = 0
    d = defaultdict(bool)
    WA = [0]*(N+1)
    for i in range(M):
        S, P = LSI()
        S = int(S)
        if P=="WA":
            WA[S] +=1
        elif P=="AC":
            if d[S]:
                continue
            else:
                d[S] = True
                ansT +=1
                ansP +=WA[S]
    print(ansT,ansP)
    return


def bfs_grid(h,w,s,maze):
    distance = [[-1]*w for _ in range(h)]
    def bfsg():
        queue = deque()
        queue.append(s)
        distance[s[0]][s[1]] = 0
        while len(queue):
            y, x = queue.popleft()
            for i in range(4):
                nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
                if (0<= nx <w and 0<= ny <h and maze[ny][nx] != '
                    if distance[ny][nx]<=distance[y][x]+1 and distance[ny][nx]!=-1:
                        continue
                    queue.append((ny, nx))
                    distance[ny][nx] = distance[y][x] + 1
        return distance
    return bfsg()
def examD():
    H,W = LI()
    S = [SI() for _ in range(H)]
    ans = 0
    for i in range(H):
        for j in range(W):
            if S[i][j]=="
                continue
            D = bfs_grid(H, W, [i, j], S)

            cur = 0
            for d in D:
                cur = max(cur,max(d))
            ans = max(ans,cur)
    print(ans)
    return

class combination():
    
    def __init__(self, n, mod):
        self.n = n
        self.fac = [1] * (n + 1)
        self.inv = [1] * (n + 1)
        for j in range(1, n + 1):
            self.fac[j] = self.fac[j - 1] * j % mod

        self.inv[n] = pow(self.fac[n], mod - 2, mod)
        for j in range(n - 1, -1, -1):
            self.inv[j] = self.inv[j + 1] * (j + 1) % mod

    def comb(self, n, r, mod):
        if r > n or n < 0 or r < 0:
            return 0
        return self.fac[n] * self.inv[n - r] * self.inv[r] % mod
def examE():
    N, K = LI()
    A = LI(); A.sort()
    maxN = 0; minN = 0
    C = combination(N,mod)
    d = defaultdict(int)
    dL = defaultdict(int)
    for i,a in enumerate(A):
        d[a] +=1
        if d[a]==1:
            dL[a] = i
    for key,i in d.items():
        cur = dL[key]+d[key]

        maxN += (C.comb(cur,K,mod)-C.comb(cur-d[key],K,mod))*key
        cur = N-dL[key]
        minN += (C.comb(cur,K,mod)-C.comb(cur-d[key],K,mod))*key
        maxN %=mod
        minN %=mod

    ans = (maxN - minN +mod)%mod
    print(ans)
    return
def C_R(x1,y1,x2,y2):
    return ((x1-x2)**2+(y1-y2)**2)**0.5
def C_R2(x1,y1,x2,y2):
    return ((x1-x2)**2-(y1-y2)**2)
def examF():
    N = I()
    XY = [LI() for _ in range(N)]
    ans = inf
    for i in range(N):
        x1 = XY[i][0]; y1 = XY[i][1]
        for j in range(i+1,N):

            x2 = XY[j][0]; y2 = XY[j][1]
            cur = C_R(x1,y1,x2,y2)
            curx = (x1+x2)/2; cury = (y1+y2)/2
            flag = True
            for l in range(N):
                now = 2*C_R(XY[l][0],XY[l][1],curx,cury)
                if now>cur+10**(-8):
                    flag = False
                    break
            if flag:
                ans = min(ans,cur)

            for k in range(j+1,N):
                x3 = XY[k][0]; y3 = XY[k][1]
                Da = C_R(x1,y1,x2,y2)
                Db = C_R(x2,y2,x3,y3)
                Dc = C_R(x3,y3,x1,y1)
                if abs((Da+Db+Dc)*(Da+Db-Dc)*(Da+Dc-Db)*(Db+Dc-Da))>10**(-9):
                    D = 2*(Da*Db*Dc)/((Da+Db+Dc)*(Da+Db-Dc)*(Da+Dc-Db)*(Db+Dc-Da))**0.5
                    a = x1-x2; b = y1-y2; c = x2-x3; d = y2-y3
                    if abs(a*d-b*c)<10**(-9):
                        continue
                    curx = (C_R2(x1,y1,x2,y2)*d-C_R2(x2,y2,x3,y3)*b)/2/(a*d-b*c)
                    cury = (-C_R2(x1,y1,x2,y2)*c+C_R2(x2,y2,x3,y3)*a)/2/(a*d-b*c)
                    flag = True
                    for l in range(N):
                        now = 2*C_R(XY[l][0], XY[l][1], curx, cury)
                        if now > D+10**(-8):
                            flag = False
                            break
                    if flag:
                        ans = min(ans, D)
    print(ans/2)
    return

def examF2():
    def minimum_bounding_circle(n,ps):
        random.shuffle(ps)
        
        def in_circle(p,c):
            return c is not None and math.hypot(p[0] - c[0], p[1] - c[1]) < c[2] + _ep

        def make_circle_2(a,b):
            c = [0]*2
            for i in range(2):
                c[i] = (a[i]+b[i])/2
            r2 = ((a[1]-c[1])**2 + (a[0]-c[0])**2)**0.5
            return (c[0],c[1],r2)

        def make_circle_3(p0, p1, p2):
            
            ax = p0[0]; ay = p0[1]
            bx = p1[0]; by = p1[1]
            cx = p2[0]; cy = p2[1]
            d = (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)) * 2.0
            if d == 0.0:
                return None
            x = ((ax * ax + ay * ay) * (by - cy) + (bx * bx + by * by) * (cy - ay) + (cx * cx + cy * cy) * (
                        ay - by)) / d
            y = ((ax * ax + ay * ay) * (cx - bx) + (bx * bx + by * by) * (ax - cx) + (cx * cx + cy * cy) * (
                        bx - ax)) / d
            return (x, y, math.hypot(x - ax, y - ay))

        c = make_circle_2(ps[0],ps[1])

        for i in range(2,n):
            if not in_circle(ps[i], c):
                c = make_circle_2(ps[0], ps[i])
                for j in range(i):
                    if not in_circle(ps[j], c):
                        c = make_circle_2(ps[i], ps[j])
                        for k in range(j):
                            if not in_circle(ps[k], c):
                                c = make_circle_3(ps[i], ps[j], ps[k])
        return c
    N = I()
    P = [[]for _ in range(N)]
    for i in range(N):
        x, y = LI()
        P[i] = [x,y]
    ans = minimum_bounding_circle(N,P)
    print(ans[2])
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examF2()

Solution (Python):
from itertools import combinations
INFTY = 10**4
epsilon = 1e-10
def dist(x,y):
    return ((x[0]-y[0])**2+(x[1]-y[1])**2)**0.5
def cross(x,y):
    return x[0]*y[1]-x[1]*y[0]
def dot(x,y):
    return x[0]*y[0]+x[1]*y[1]
N = int(input())
X = [list(map(int,input().split())) for _ in range(N)]
rmin = INFTY
for z in combinations(range(N),3):
    i,j,k = z
    x0,y0 = X[i]
    x1,y1 = X[j]
    x2,y2 = X[k]
    r = max(dist(X[i],X[j]),dist(X[j],X[k]),dist(X[k],X[i]))/2
    if r==dist(X[i],X[j])/2:
        x = (x0+x1)/2
        y = (y0+y1)/2
    elif r==dist(X[j],X[k])/2:
        x = (x1+x2)/2
        y = (y1+y2)/2
    else:
        x = (x2+x0)/2
        y = (y2+y0)/2
    a = cross([x1-x0,y1-y0],[x2-x0,y2-y0])
    if a==0:continue
    if dot([x1-x0,y1-y0],[x2-x0,y2-y0])>=0 and dot([x0-x1,y0-y1],[x2-x1,y2-y1])>=0 and dot([x1-x2,y1-y2],[x0-x2,y0-y2])>=0:
        s = ((x1-x0)**2+(y1-y0)**2-(x0+x1-2*x2)**2-(y0+y1-2*y2)**2)/8
        s = s/(x0*y1-x1*y0-x2*y1+x2*y0-x0*y2+x1*y2)
        x = (x0+x1)/2+s*(y1-y0)
        y = (y0+y1)/2+s*(x0-x1)
        r = dist([x,y],[x0,y0])
    flag = 0
    for i in range(N):
        if dist([x,y],X[i])<=r+epsilon:
            continue
        else:
            flag = 1
            break
    if flag==0:
        rmin = min(rmin,r)
if rmin==INFTY:
    rmin = 0
    for i in range(N-1):
        for j in range(i+1,N):
            rmin = max(rmin,dist(X[i],X[j]))
    print(rmin/2)
else:
    print(rmin)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    P = [[int(x) for x in input().split()] for _ in range(N)]
    eps = 0.000000001
    minR = 10**10
    if N == 2:
        r = (P[1][0] - P[0][0]) ** 2 + (P[1][1] - P[0][1])** 2
        r = (r ** 0.5) / 2
        print(r)
        return 0
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            a, b = P[i]
            c, d = P[j]
            x, y = (a + c)/2, (b + d)/2
            rd = (x - a) ** 2 + (y - b) ** 2
            for l in range(N):
                if l != i and l != j:
                    if (P[l][0] - x) ** 2 + (P[l][1] - y) ** 2 - rd > eps: break
            else: minR = min(minR, rd)

            for k in range(j + 1, N):
                if (P[j][1] - P[i][1]) * (P[k][0]-P[j][0]) == (P[j][0] - P[i][0]) * (P[k][1]-P[j][1]): continue

                e, f = P[k]
                if c == a: 
                    y = (d + b) / 2
                    if d == f: x = (d + f) / 2
                    else: x = (e + c) / 2 + ((d + f)/2 - y) * (f - d) / (e - c)
                elif e == c: 
                    y = (d + f ) / 2
                    if d == b: x = (d + b) / 2
                    else: x = (a + c) / 2 + ((b + d)/ 2 - y) * (d - b) / (c - a)
                elif d == b: 
                    x = (a + c) / 2
                    y = (d + f) / 2 + ((e + c)/2 - x) * (e - c) / (f - d)
                elif f == d: 
                    x = (c + e) / 2
                    y = (b + d) / 2 + ((c + a)/2 - x) * (c - a) / (d - b)
                else:
                    x = ((c**2 - a**2) / (2 * (d - b)) - (e ** 2 - c ** 2)/(2 * (f - d)) - (f - b)/2) * ((d - b) * (f - d) / ((c - a)*(f - d) - (e - c) * (d - b)))
                    y = (d + f) / 2 + ((e + c)/2 - x) * (e - c) / (f - d)
                rd = (x - a) ** 2 + (y - b) ** 2
                for l in range(N):
                    if l != i and l != j and l != k:
                        if (P[l][0] - x) ** 2 + (P[l][1] - y) ** 2 - rd > eps: break
                else: minR = min(minR, rd)
    print(minR ** 0.5)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):

import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def 外心(p1,p2,p3):
    
    a,b = p1
    c,d = p2
    e,f = p3
    aa = a * a
    bb = b * b
    cc = c * c
    dd = d * d
    ee = e * e
    ff = f * f
    
    if (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) == 0:
        return 0, 0

    py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

    if c == a:
        px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a))
    else:
        px = (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

    return px, py

n = int(input())
points = [list(map(int, input().split())) for i in range(n)]

from itertools import combinations

候補 = []

for p1, p2 in combinations(points, 2):
    px, py = (p1[0]+p2[0])/2, (p1[1]+p2[1])/2
    候補.append((px, py))


for p1, p2, p3 in combinations(points, 3):
    候補.append(外心(p1,p2,p3))

from math import sqrt

ans = float("Inf")
for x,y in 候補:
    tmp = 0
    for px, py in points:
        tmp = max(tmp, (px-x)**2 + (py-y)**2)
    ans = min(ans, tmp)
ans = sqrt(ans)
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


def dprint(*args):
  if LOCAL:
    print(*args)


n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]


import math
import itertools


def distanse(x1, y1, x2, y2):
  return math.sqrt((x1 - x2)**2 + (y1 - y2)**2)


def isValid(ox, oy, r):
  
  global xy
  for x, y in xy:
    if distanse(x, y, ox, oy) - r > 1e-6:
      return False
  return True


rs = []
for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2):
  dprint(x1, y1, x2, y2)
  r = distanse(x1, y1, x2, y2) / 2
  ox = (x1 + x2) / 2
  oy = (y1 + y2) / 2
  dprint(ox, oy, r)
  if isValid(ox, oy, r):
    rs.append(r)





for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3):
  
  a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2
  b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \
      (y1 - y3) + (x3**2 + y3**2) * (y2 - y1)
  c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \
      (x3 - x1) + (x3**2 + y3**2) * (x1 - x2)
  d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \
      (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2)
  if a == 0:
    continue
  ox = -b / (2 * a)
  oy = -c / (2 * a)
  r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2))
  if isValid(ox, oy, r):
    rs.append(r)

dprint(rs)

print(min(rs))

Solution (Python):
import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


def dprint(*args):
  if LOCAL:
    print(*args)


n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]


import math
import itertools


def distanse(x1, y1, x2, y2):
  return math.sqrt((x1 - x2)**2 + (y1 - y2)**2)


def isValid(ox, oy, r):
  
  global xy
  for x, y in xy:
    if distanse(x, y, ox, oy) - r > 1e-6:
      return False
  return True


rs = []
for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2):
  dprint(x1, y1, x2, y2)
  r = distanse(x1, y1, x2, y2) / 2
  ox = (x1 + x2) / 2
  oy = (y1 + y2) / 2
  dprint(ox, oy, r)
  if isValid(ox, oy, r):
    rs.append(r)





for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3):
  
  a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2
  b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \
      (y1 - y3) + (x3**2 + y3**2) * (y2 - y1)
  c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \
      (x3 - x1) + (x3**2 + y3**2) * (x1 - x2)
  d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \
      (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2)
  if a == 0:
    continue
  ox = -b / (2 * a)
  oy = -c / (2 * a)
  r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2))
  if isValid(ox, oy, r):
    rs.append(r)

dprint(rs)
print('{:.18f}'.format(min(rs)))

Solution (Python):
from math import sqrt
import itertools

N = int(input())
P = []
for i in range(N):
  P.append(list(map(int, input().split())))
  
def dist(P,Q):
  return sqrt( (P[0]-Q[0]) ** 2 + (P[1]-Q[1]) ** 2 )

def isFound(R):
  for i,j in itertools.combinations(list(range(N)),2):
    if dist(P[i], P[j]) >= 2*R:
      continue
    
    x1,y1 = P[i]
    x2,y2 = P[j]
    PM = dist(P[i], P[j])/2
    
    xm,ym = (x1+x2)/2, (y1+y2)/2
    
    
    
    x_ev, y_ev = y2-y1, x1-x2
    norm_ev = sqrt(x_ev**2 + y_ev**2)
    x_ev, y_ev = x_ev / norm_ev, y_ev / norm_ev
    
    MM = sqrt( R**2 - PM**2 )

    P1 = [xm + x_ev * MM, ym + y_ev * MM]
    P2 = [xm - x_ev * MM, ym - y_ev * MM]
    
    
    
    for v in [P1, P2]:
      flg = False
      for p in P:
        if dist(v,p) > R + 1e-7: 
          flg = True
          break
      if flg:
        continue
      else:
        return True
  
  return False


l,r = 0, 1001

for i in range(100):
  m = (l+r)/2
  
  if isFound(m):
    r = m
  else:
    l = m
        
print(m)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7

def inp(): return int(input()) 
def inpm(): return map(int,input().split()) 
def inpl(): return list(map(int, input().split())) 
def inpls():return list(input().split())  
def inpim(n): return list(int(input()) for _ in range(n)) 
def inplm(n): return [list(input()) for _ in range(n)]
def inptm(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)] 
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)] 
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def S(p1,p2,p3):
    a,b = p1
    c,d = p2
    e,f = p3
    return abs((d-b)*(e-a) - (f-b)*(c-a))
 
def disk(p1,p2,p3):
    x1,y1 = p1
    x2,y2 = p2
    x3,y3 = p3
    a2 = (x2 - x3) **2 + (y2 -y3) ** 2 
    b2 = (x1 - x3) **2 + (y1 -y3) ** 2
    c2 = (x2 - x1) **2 + (y2 -y1) ** 2
    area = ((x2 - x1) * (y3 -y1) - (x3 -x1) * (y2- y1)) / 2
    if area == 0:
        return (0,0),10**5
    x = (a2*(b2+c2-a2)*x1 + b2*(c2+a2-b2)*x2 +c2*(a2+b2-c2)*x3) / (16*area*area)
    y = (a2*(b2+c2-a2)*y1 + b2*(c2+a2-b2)*y2 +c2*(a2+b2-c2)*y3) / (16*area*area) 
    r = ((x1 - x ) ** 2 + (y1 - y) ** 2)**.5
    return (x,y), r

def circumcircle(): 
    n = inp()
    l = inplt(n)
    ans = 10**5
    dist = lambda p,q: ((p[0]-q[0])**2 + (p[1]-q[1])**2)**.5
    check = lambda c,d: all(dist(c,p)<=d for p in l)
    for i in range(n-1):
        for j in range(i+1,n):
            c = ((l[i][0]+l[j][0])/2, (l[i][1]+l[j][1])/2)
            d = dist(l[i],l[j])/2
            if check(c,d) and d < ans:
                ans = d
    for i in range(n-2):
        for j in range(i+1,n-1):
            for k in range(j+1,n):
                c,d = disk(l[i],l[j],l[k])
                if check(c,d) and d < ans:
                    ans = d
    print(ans)
    
def main():
    circumcircle()
    
if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np
from itertools import combinations

N = int(input())

P = [np.array(list(map(int,input().split())), dtype=float) for _ in range(N)]

d2 = lambda v: np.sum(np.square(v))

def radius(A,B,C):
    a = d2(B-C)
    b = d2(C-A)
    c = d2(A-B)

    r = float('inf')
    if c > d2(A+B - 2*C):
        r = min(r, c)

    if a > d2(B+C - 2*A):
        r = min(r, a)

    if b > d2(C+A - 2*B):
        r = min(r, b)

    if r != float('inf'):
        return r/4

    U = a*(b+c-a)*A + b*(c+a-b)*B + c*(a+b-c)*C
    v = a*(b+c-a) + b*(c+a-b) + c*(a+b-c)
    U /= v
    r = d2(U-A)
    return r

if N == 2:
    print(np.linalg.norm(P[0]-P[1])/2)
else:
    print(np.sqrt(max(radius(a,b,c) for a,b,c in combinations(P,3))))

Solution (Python):
import numpy as np
from itertools import combinations

N = int(input())

P = [np.array(list(map(int,input().split())), dtype=float) for _ in range(N)]

d2 = lambda v: np.sum(np.square(v))

def radius(A,B,C):
    a = d2(B-C)
    b = d2(C-A)
    c = d2(A-B)

    r = float('inf')
    if c > d2(A+B - 2*C):
        r = min(r, c)

    if a > d2(B+C - 2*A):
        r = min(r, a)

    if b > d2(C+A - 2*B):
        r = min(r, b)

    if r != float('inf'):
        return np.sqrt(r)/2

    U = a*(b+c-a)*A + b*(c+a-b)*B + c*(a+b-c)*C
    v = a*(b+c-a) + b*(c+a-b) + c*(a+b-c)
    U /= v
    r = np.linalg.norm(U-A)
    return r

if N == 2:
    print(np.linalg.norm(P[0]-P[1])/2)
else:
    print(max(radius(a,b,c) for a,b,c in combinations(P,3)))

Solution (Python):
i=input
from scipy.optimize import*
t=[list(map(int,i().split()))for _ in[0]*int(i())]
c=lambda k:max([(x-k[0])**2+(y-k[1])**2for x,y in t])
print(c(fmin(c,[500]*2,disp=0))**0.5)

Solution (Python):
N=int(input())
X,Y=[0]*N,[0]*N
for i in range(N):
    X[i],Y[i]=map(int,input().split())

def check(a,b,r):
    if r<0:r=0
    res=[0,0,0]
    flg=True
    for i in range(N):
        tmp=(X[i]-a)**2+(Y[i]-b)**2
        if tmp>r**2:
            flg=False
        if tmp>res[0]:
            res=[tmp,X[i],Y[i]]
    res[0]=flg
    return res

x_ave,y_ave=sum(X)/N,sum(Y)/N
MIN=10**(-12)
r=1500
r_diff=r/2
k=0.5
d=999/1000



while r_diff>MIN:
    tmpres = check(x_ave,y_ave,r)
    
    if tmpres[0]:
        r-=r_diff
    else:
        r+=r_diff
    x_ave+=(tmpres[1]-x_ave)*k
    y_ave+=(tmpres[2]-y_ave)*k
    r_diff=r_diff*d
    k=k*d

print(r)

Solution (Python):
import math
from itertools import combinations
n = int(input())
p = [list(map(int, input().split())) for i in range(n)]
def enclose(points):

    a = points[0]
    b = points[1]
    c = points[2]
    d = points[3]
    e = points[4]
    f = points[5]

    aa = a * a
    bb = b * b
    cc = c * c
    dd = d * d
    ee = e * e
    ff = f * f

    py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

    px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
        if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

    r = math.hypot(px - a, py - b)

    return (px, py, r)


ans = 1000000

if n >= 3:
    for i, j, k in combinations(range(n), 3):
        points = []
        points.extend(p[i])
        points.extend(p[j])
        points.extend(p[k])
        try:
            px, py, r = enclose(points)
        except:
            continue
        flag = 1
        for l in range(n):
            if (px-p[l][0])**2 + (py-p[l][1])**2 > r**2 + 0.0000001:
                flag = 0
                break
        if flag == 1:
            ans = min(ans, r)

for i, j in combinations(range(n), 2):
    px = (p[i][0]+p[j][0]) / 2
    py = (p[i][1]+p[j][1]) / 2
    r = ((p[i][0] - px)**2 + (p[i][1] - py) ** 2) ** (1/2)
    flag = 1
    for l in range(n):
        if (px-p[l][0])**2 + (py-p[l][1])**2 > r**2 + 0.0000001:
            flag = 0
            break
    if flag == 1:
        ans = min(ans, r)

print(ans)

Solution (Python):
import itertools
import math


def distance(a, b):
    """点a(a_x, a_y)と点b(b_x, b_y)の距離を返す関数"""
    a_x, a_y = a
    b_x, b_y = b
    d = ((a_x - b_x)**2 + (a_y - b_y)**2) ** 0.5
    return d


def edges(a, b, c, sort=False):
    """三角形abcの辺の長さを返す関数（sort=Trueにした場合、長い順に返す）"""
    a_x, a_y = a
    b_x, b_y = b
    c_x, c_y = c
    d1 = ((a_x - b_x)**2 + (a_y - b_y)**2) ** 0.5
    d2 = ((b_x - c_x)**2 + (b_y - c_y)**2) ** 0.5
    d3 = ((c_x - a_x)**2 + (c_y - a_y)**2) ** 0.5
    if sort:
        d1, d2, d3 = sorted([d1, d2, d3], reverse=True)
    return d1, d2, d3


def is_acute(d1, d2, d3):
    """3辺の長さより鋭角三角形かどうかを真偽値で返す"""
    d1, d2, d3 = sorted([d1, d2, d3], reverse=True)
    return d1**2 < d2**2 + d3**2


N = int(input())
xy = tuple(tuple(int(i) for i in input().split()) for _ in range(N))

if N == 2:
    ans = distance(xy[0], xy[1]) / 2
else:
    ans = 0
    for p1, p2, p3 in itertools.combinations(xy, 3):
        d1, d2, d3 = edges(p1, p2, p3)
        if is_acute(d1, d2, d3):
            r = d1*d2*d3 / ((d1+d2+d3)*(d1+d2-d3)*(d1-d2+d3)*(-d1+d2+d3))**0.5
            ans = max(ans, r)
        else:
            r = max(d1, d2, d3) / 2
            ans = max(ans, r)

print(ans)

Solution (Python):
import math

def all_points(x, y):
	return max(one_point(x, y, _x, _y) for _x, _y in points)

def one_point(x0, y0, x1, y1):
	return math.pow(x0-x1, 2) + math.pow(y0-y1, 2)

def two():
	for i in range(N):
		for j in range(i+1, N):
			yield (points[i], points[j])

def three():
	for i in range(N):
		for j in range(i+1, N):
			for k in range(j+1, N):
				yield (points[i], points[j], points[k])

def process_two():
	minimum = 1e18
	for (a, b), (c, d) in two():
		x, y = (a+c)/2, (b+d)/2
		minimum = min(minimum, all_points(x, y))
	return minimum

def process_three():
	minimum = 1e18
	for (a,b), (c,d), (e,f) in three():
		try:
			if b==d==f:
				continue
			if d==b:
				a, b, c, d, e, f = e, f, a, b, c, d
			if f==b:
				a, b, c, d, e, f = c, d, e, f, a, b
			m0x, m0y = (a+c)/2, (b+d)/2
			m0 = -(c-a)/(d-b)
			b0 = m0y - m0*m0x
			
			m1x, m1y = (a+e)/2, (b+f)/2
			m1 = -(e-a)/(f-b)
			b1 = m1y - m1*m1x

			x = (b1-b0) / (m0-m1)
			y = m0*x + b0

			minimum = min(minimum, all_points(x, y))
		except ZeroDivisionError:
			continue
	return minimum


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


print(math.sqrt(min(process_two(), process_three())))

Solution (Python):

import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  
  naE = naP[iImax]
  
  
  
  
  
  
  
  naXY0+=naE*fA
  fA*=0.9998
print(naR[iImax]**0.5)

Solution (Python):
import math

def all_points(x, y):
	return max(one_point(x, y, _x, _y) for _x, _y in points)

def one_point(x0, y0, x1, y1):
	return math.pow(x0-x1, 2) + math.pow(y0-y1, 2)

def two():
	for i in range(N):
		for j in range(i+1, N):
			yield (points[i], points[j])

def three():
	for i in range(N):
		for j in range(i+1, N):
			for k in range(j+1, N):
				yield (points[i], points[j], points[k])

def process_two():
	minimum = 1e18
	for (a, b), (c, d) in two():
		x, y = (a+c)/2, (b+d)/2
		minimum = min(minimum, all_points(x, y))
	return minimum

def process_three():
	minimum = 1e18
	for (a,b), (c,d), (e,f) in three():
		try:
			if b==d==f:
				continue
			if d==b:
				a, b, c, d, e, f = e, f, a, b, c, d
			if f==b:
				a, b, c, d, e, f = c, d, e, f, a, b
			m0x, m0y = (a+c)/2, (b+d)/2
			m0 = -(c-a)/(d-b)
			b0 = m0y - m0*m0x
			
			m1x, m1y = (a+e)/2, (b+f)/2
			m1 = -(e-a)/(f-b)
			b1 = m1y - m1*m1x

			x = (b1-b0) / (m0-m1)
			y = m0*x + b0

			minimum = min(minimum, all_points(x, y))
		except ZeroDivisionError:
			continue
	return minimum


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


print(math.sqrt(min(process_two(), process_three())))

Solution (Python):
n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int, input().split())))

from scipy.optimize import fmin

def calc(k):
    i,j = k
    return max((x-i)**2 + (y-j)**2 for x,y in xy)

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

print(calc([x,y])**0.5)

Solution (Python):
import sys

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







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
		return max((x - i) ** 2 + (y - j) ** 2 for x,y in xy)

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



if __name__ == "__main__":
	main()

Solution (Python):
import sys

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







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
		return max((x - i) ** 2 + (y - j) ** 2 for x,y in xy)

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



if __name__ == "__main__":
	main()