#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include <string>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <queue>
#include <deque>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <time.h>
#include <assert.h>
using namespace std;
typedef long long ll;
#define _(a, b) memset((a), (b), sizeof(a))
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, V) for(__typeof((V).begin()) it = (V).begin(); it != (V).end(); ++it)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define pii pair<int, int>
template<typename T> int size(T& a) { return (int)a.size(); }
template<typename T> T sqr(T a) {return a * a; }
struct pt {
double x, y ;
pt(double x =0, double y = 0) : x(x), y(y) {}
void scan(){
cin >> y >> x;
}
pt operator + (const pt& o) {
return pt(x + o.x, y + o.y);
}
pt operator - (const pt & o) {
return pt(x - o.x, y - o.y);
}
pt operator * (const double& d) {
return pt(x * d, y * d);
}
pt operator / (const double& d) {
return pt(x / d, y / d);
}
double operator ^ (const pt & o) {
return x * o.y - y * o.x;
}
pt rotate(double alpha) {
double nx = x * cos(alpha) - y * sin(alpha);
double ny = x * sin(alpha) + y * cos(alpha);
return pt(nx, ny);
}
double length(const pt& o) {
return sqrt(sqr(x - o.x) + sqr(y - o.y));
}
void setLength(const double &d) {
double z = sqrt(sqr(x) + sqr(y));
x = x / z * d;
y = y / z * d;
}
} ;
pt a[51];
double ans = 1e9;
double all = 0;
int n;
const double EPS = 1e-7;
const double PI = asin(1.0) * 2;
void calcAll() {
double s =0 ;
REP(i, 0, n) s += a[i] ^ a[(i + 1) % n];
s = fabs(s) / 2;
all = s;
}
double square(pt a, pt b, pt c) {
return fabs((a ^ b) + (b ^ c) + (c ^ a)) / 2;
}
bool Equal(double a, double b){
return fabs(a - b) < EPS;
}
bool Less(double a, double b){
return a + EPS < b;
}
bool Great(double a, double b) {
return a > b + EPS;
}
double getAngle(double a, double b, double c) {
// c * c = a * a + b * b - 2 * a * b * cos(alpha)
// alpha = acos( c * c - a * a - b * b / (-2 * a * b)) ;
return acos( (sqr(c) - sqr(a) - sqr(b)) / (- 2 * a * b)) ;
}
pt calc(pt a, pt b, pt c, double need) {
double alpha = getAngle(a.length(b), b.length(c), a.length(c));
double res = 2 * need / (sin(alpha) * a.length(b));
double O = sqrt(sqr(res) + sqr(a.length(b)) - 2 * res * a.length(b) * cos(alpha));
double g = asin(res * sin(alpha) / O);
pt gg = (b - a);
gg = gg.rotate(-g);
gg.setLength(O);
// end - beg = vec
pt r = gg + a;
return r;
}
pt go(pt x, int &nxt) {
double cur = 0;
while (1) {
double d = square(x, a[nxt], a[(nxt + 1) % n]);
if (Equal(cur + d, all / 2)) {
pt ret = a[(nxt + 1) % n];
return ret;
} else if (Less(cur + d, all / 2)) {
nxt = (nxt + 1) % n;
} else {
pt ret = calc(x, a[nxt], a[(nxt + 1) % n], all / 2 - cur);
return ret;
}
cur += d;
}
}
bool btw(pt a, pt b, pt c) {
return Equal(a.length(b), a.length(c) + b.length(c));
}
vector<pt> build(pt a, pt b, int r){
int n1 , n2 ;
n1 = r;
n2 = n1;
pt c = go(a, n1);
pt d = go(b, n2);
static vector<pt> res ;
res.clear();
for(int i = n1; ; i = (i + 1) % n){
if (btw(::a[i], ::a[(i + 1) % n], c) && btw(::a[i], ::a[(i + 1) % n], d)) {
res.pb (c);
res.pb (d);
break;
} else if (btw(::a[i], ::a[(i + 1) % n], c)) {
res.pb (c);
} else if ( btw(::a[i], ::a[(i + 1) % n], d)) {
res.pb(::a[i]);
res.pb (d);
break;
} else {
res.pb(::a[i]);
}
if (i == n2) break;
}
return res;
}
void solve() {
scanf("%d", &n);
REP(i, 0, n) a[i].scan();
calcAll();
REP(i, 0, n) {
vector<pt> tmp = build(a[i], a[(i + 1) % n], i);
vector<int> idx(size(tmp));
REP(z, 0, size(tmp)) {
REP(j, 0, n) if (btw(a[j], a[(j + 1) % n], tmp[z]))
idx[z] = (j + 1) % n;
}
REP(j, 0, size(tmp) - 1) {
pt L = tmp[j], R = tmp[j + 1];
REP(iter,0,70) {
pt M1 = L + (R - L) / 3;
pt M2 = R - (R - L) / 3;
int tt = idx[j];
pt P1 = go(M1, tt);
tt = idx[j];
pt P2 = go(M2, tt);
double f1 = P1.length(M1);
double f2 = P2.length(M2);
if (Less(f1 , f2)) {
R = M2;
} else {
L = M1;
}
ans = min(ans, f1);
ans = min(ans, f2);
}
}
}
printf("%.10lf", ans);
}
int main() {
#ifdef air
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
solve();
#ifdef air
printf("\n\n%.3lf", (clock() ) * 1e-3);
#endif
}
I2RlZmluZSBfQ1JUX1NFQ1VSRV9OT19XQVJOSU5HUwojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxzc3RyZWFtPgogCiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPGRlcXVlPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c2V0PgogCiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxtYXRoLmg+CiNpbmNsdWRlIDx0aW1lLmg+CiNpbmNsdWRlIDxhc3NlcnQuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdHlwZWRlZiAgbG9uZyBsb25nIGxsOwogCiNkZWZpbmUgXyhhLCBiKSBtZW1zZXQoKGEpLCAoYiksIHNpemVvZihhKSkKI2RlZmluZSBSRVAoaSwgYSwgYikgZm9yKGludCBpID0gKGEpOyBpIDwgKGIpOyArK2kpCiNkZWZpbmUgUkVQRChpLCBhLCBiKSBmb3IoaW50IGkgPSAoYikgLSAxOyBpID49IChhKTsgLS1pKSAKI2RlZmluZSBJVEVSKGl0LCBWKSBmb3IoX190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