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 in Go (1.6) (judge verdict: Accepted)

package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "math"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt() int {
  n, _ := strconv.Atoi(NextLine())
  return n
}
func NextFloatVec() []float64 {
  L := strings.Split(NextLine(), " ")
  N := make([]float64, len(L))
  for i := range N {
    N[i], _ = strconv.ParseFloat(L[i], 64)
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

func Dist(A, B *[]float64) float64 {
  D := 0.0
  for i, a := range (*A) {
    x := (*B)[i] - a
    D += x * x
  }
  return math.Sqrt(D)
}
func CrossPoint(A, B *[]float64, R float64) []*[]float64 {
  AB := Dist(A, B)
  C := math.Sqrt(4.0 * R * R / (AB * AB) - 1)
  x1 := (((*A)[0] + (*B)[0]) + ((*A)[1] - (*B)[1]) * C) / 2.0
  y1 := (((*A)[1] + (*B)[1]) - ((*A)[0] - (*B)[0]) * C) / 2.0
  x2 := (((*A)[0] + (*B)[0]) - ((*A)[1] - (*B)[1]) * C) / 2.0
  y2 := (((*A)[1] + (*B)[1]) + ((*A)[0] - (*B)[0]) * C) / 2.0
  p1 := []float64{x1, y1}
  p2 := []float64{x2, y2}
  return []*[]float64{&p1, &p2}
}

func main() {
  N := NextInt()
  P := make([]*[]float64, N)
  for i := range P {
    p := NextFloatVec()
    P[i] = &p
  }
  D := make([][]float64, N)
  for i := range D {
    D[i] = make([]float64, N)
    for j := range D[i] {
      D[i][j] = Dist(P[i], P[j])
    }
  }
  R := math.Sqrt(2.0 * 500.0 * 500.0)
  r := 0.0
  diff := float64(1e-7)
  for diff < R - r {
    _r := (R + r) / 2.0
    Include := 0
    for i := 0; i < N - 1 && Include == 0; i++ {
      for j := i + 1; j < N && Include == 0 ; j++ {
        if 2.0 * _r < D[i][j] {
          Include = -1
          break
        }
        CP := CrossPoint(P[i], P[j], _r)
        if D[i][j] < _r {
          CP = append(CP, []*[]float64{P[i], P[j]}...)
        }
        for _, cp := range CP {
          inc := true
          for _, p := range P {
            if _r + diff < Dist(p, cp) {
              inc = false
              break
            }
          }
          if inc {
            Include = 1
            break
          }
        }
      }
    }
    if Include < 1 {
      r = _r
    } else {
      R = _r
    }
  }
  Write(R)
  Output()
}