You are given a convex polygon P with n distinct vertices p_1, p_2, ..., p_{n}. Vertex p_{i} has coordinates (x_{i}, y_{i}) in the 2D plane. These vertices are listed in clockwise order.

You can choose a real number D and move each vertex of the polygon a distance of at most D from their original positions.

Find the maximum value of D such that no matter how you move the vertices, the polygon does not intersect itself and stays convex.


-----Input-----

The first line has one integer n (4 ≤ n ≤ 1 000) — the number of vertices.

The next n lines contain the coordinates of the vertices. Line i contains two integers x_{i} and y_{i} ( - 10^9 ≤ x_{i}, y_{i} ≤ 10^9) — the coordinates of the i-th vertex. These points are guaranteed to be given in clockwise order, and will form a strictly convex polygon (in particular, no three consecutive points lie on the same straight line).


-----Output-----

Print one real number D, which is the maximum real number such that no matter how you move the vertices, the polygon stays convex.

Your answer will be considered correct if its absolute or relative error does not exceed 10^{ - 6}.

Namely, let's assume that your answer is a and the answer of the jury is b. The checker program will consider your answer correct if $\frac{|a - b|}{\operatorname{max}(1, b)} \leq 10^{-6}$.


-----Examples-----
Input
4
0 0
0 1
1 1
1 0

Output
0.3535533906

Input
6
5 0
10 0
12 -4
10 -8
5 -8
3 -4

Output
1.0000000000



-----Note-----

Here is a picture of the first sample

[Image]

Here is an example of making the polygon non-convex.

[Image]

This is not an optimal solution, since the maximum distance we moved one point is  ≈ 0.4242640687, whereas we can make it non-convex by only moving each point a distance of at most  ≈ 0.3535533906.

Difficulty: interview

Starter code:

Solutions:
class Vector:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
    def __add__(self, other):
        return Vector(self.x + other.x, self.y + other.y)
    
    def __sub__(self, other):
        return Vector(self.x - other.x, self.y - other.y)
    
    def to(self, other):
        return other - self
    
    def __repr__(self):
        return "(%s %s)" % (self.x, self.y)

    def dot(self, other):
        return self.x * other.y - self.y * other.x
    
    def lensq(self):
        return self.x ** 2 + self.y ** 2

Vec = Vector

def getH(p, a, b):
    s2 = p.to(a).dot(p.to(b))
    # a * h / 2 = s
    # h = s * 2 / a
    return s2 / (a.to(b).lensq() ** 0.5)

pts = [Vec(*list(map(int, input().split()))) for i in range(int(input()))]
n = len(pts)
pts.append(pts[0])
pts.append(pts[1])

ans = 12351513153155135135

for i in range(n):
    ans = min(ans, getH(pts[i + 1], pts[i], pts[i + 2])/2)

print(ans)


from math import hypot


n = int(input())


def square(a, b, c):
	first = [a[0] - c[0], a[1] - c[1]]
	second = [b[0] - c[0], b[1] - c[1]]
	return abs(first[0] * second[1] - first[1] * second[0])

def height(a, b, c):
	return square(a, b, c) / hypot(a[0] - b[0], a[1] - b[1])


points = []
for i in range(n):
	points.append(list(map(float, input().split())))
_max = 3e9

for i in range(n):
	a = points[i]
	b = points[(i + 1) % n]
	c = points[(i + 2) % n]
	_max = min(_max, (height(a, b, c) / 2))
	_max = min(_max, height(c, a, b) / 2)
	_max = min(_max, (height(b, c, a) / 2))

print(_max)

import math
from decimal import Decimal
n = int(input())
d = [[] for i in range(n)]
for i in range(n):
    d[i] = list(map(Decimal,input().split()))
def cnt(m):
    l = m - 1
    if (l < 0): l = n - 1
    r = (m + 1) % n
    lol = Decimal(2)
    a = ((d[l][0] - d[m][0])**lol + (d[l][1] - d[m][1]) ** 2)**(Decimal(1/2))
    b = ((d[m][0] - d[r][0]) ** lol + (d[m][1] - d[r][1]) ** 2)**(Decimal(1/2))
    c = ((d[l][0] - d[r][0]) ** lol + (d[l][1] - d[r][1]) ** 2)**(Decimal(1/2))
    p = (a + b + c) / lol
    s = (p * (p - a) * (p - b) * (p - c))**(Decimal(1/2))
    return Decimal(s / c)

ans = Decimal(cnt(0))
for i in range(0,n):
    ans = min(ans, cnt(i))
    # for j in range(0,n):
    #     if i == j :continue;
    #     cur = ((d[i][0] - d[j][0]) ** 2 + (d[i][1] - d[j][1]) ** 2) ** (1/2)
    #     ans = min(ans, cur / 2)

print(ans)

from math import inf

def vect(x, y):
    return abs(sum([x[i]*(y[(i+1)%3]-y[(i+2)%3]) for i in range(3)]))
def l(x, y):
    return ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5
def h(x, y):
    return vect(x, y) / l(x, y)

n = int(input())
x = []
y = []
for i in range(n):
    a, b = [int(x) for x in input().split()]
    x.append(a)
    y.append(b)
x += x[:2]
y += y[:2]

dmin = inf
for i in range(n):
    d = h(x[i:i+3], y[i:i+3])/2
    if dmin > d:
        dmin = d

print(dmin)

import math
def dist(a, b, c):
    return abs((c[1] - a[1])*b[0] - (c[0] - a[0])*b[1] + c[0]*a[1] - c[1]*a[0])/math.hypot(c[0]-a[0], c[1]- a[1]);
N = int(input())
pts = [tuple(map(int, input().split())) for _ in range(N)]
MIN = 10000000000.0
for i in range(N-2):
    MIN = min(MIN, dist(pts[i], pts[i+1], pts[i+2]))

MIN = min(MIN, dist(pts[N-2], pts[N-1], pts[0]))
MIN = min(MIN, dist(pts[N-1], pts[0], pts[1]))
print(MIN/2)





# Made By Mostafa_Khaled


import math


class Pt:
    def __init__(self, x, y):
        self.x, self.y = x, y

    def __sub__(self, other):
        return Pt(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return self.x * other.x + self.y * other.y

    def __xor__(self, other):
        return self.x * other.y - self.y * other.x

    def len(self):
        return math.sqrt(self.x ** 2 + self.y ** 2)


n = int(input())
data = []
for i in range(n):
    data.append(Pt(*list(map(int, input().split()))))
min_ = 10 ** 10
for i in range(1, n - 1):
    A = data[i - 1]
    B = data[i + 1]
    C = data[i]
    r = abs((C - A) ^ (B - A)) / (B - A).len()
    min_ = min(min_, r)
A = data[0]
B = data[n - 2]
C = data[n - 1]
r = abs((C - A) ^ (B - A)) / (B - A).len()
min_ = min(min_, r)
A = data[1]
B = data[n - 1]
C = data[0]
r = abs((C - A) ^ (B - A)) / (B - A).len()
min_ = min(min_, r)
print(min_ / 2)


import sys
import math

data = sys.stdin.read().split()
data_ptr = 0

def data_next():
    nonlocal data_ptr, data
    data_ptr += 1
    return data[data_ptr - 1]

N = int(data_next())
arr = list(zip(list(map(int, data[1::2])), list(map(int, data[2::2]))))

def cross(x1, y1, x2, y2):
    return x1 * y2 - x2 * y1

def dist(x, y):
    return math.sqrt(x * x + y * y)

ans = 4000000000.0
for i in range(N):
    x1, y1 = arr[i - 1]
    x2, y2 = arr[i]
    x1 -= arr[i - 2][0]
    x2 -= arr[i - 2][0]
    y1 -= arr[i - 2][1]
    y2 -= arr[i - 2][1]
    ans = min(ans, abs(cross(x1, y1, x2, y2) / dist(x2, y2) / 2))
print(ans)


# from decimal import *
# getcontext().prec=16
# from math import sqrt
# from scipy.special import binom
# from collections import defaultdict
# from math import sin,pi,sqrt
from math import sqrt,hypot

def dist(a, b, c):
    return abs((c[1] - a[1])*b[0] - (c[0] - a[0])*b[1] + c[0]*a[1] - c[1]*a[0])/hypot(c[0]-a[0], c[1]- a[1])/2

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

d=-1
for i in range(n):
    if i==n-1:
        a,b,c=liste[n-2],liste[n-1],liste[0]
    else:
        a,b,c=liste[i-1],liste[i],liste[i+1]
    if d!=-1:
        d=min(d,dist(a,b,c))
    else:
        d=dist(a,b,c)

print(d)

from math import *
n=int(input())
r=[list(map(int,input().split())) for _ in range(n)]
ans = 10 ** 20
for i in range(n):
	x0,y0=r[(i+n-1)%n]
	x1,y1=r[(i+1)%n]
	x,y=r[i]
	ans=min(ans,abs((y1-y0)*x-(x1-x0)*y-(x0*y1-x1*y0))/sqrt((x1-x0)**2+(y1-y0)**2))
print(ans/2)