int32_t main() {
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(10);
cerr << fixed << setprecision(10);
cin.tie(0);
//double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
int n, L;
cin>>n>>L;
vector<Point> pt;
RE (i, n) {
int x, y;
cin>>x>>y;
pt.PB({(LD)x, (LD)y});
}
reverse(ALL(pt));
REP (tr, 2) {
REP (i, n) {
pt.PB(pt[i]);
}
}
vector<LD> pref(3 * n);
RE (i, 3 * n - 2) {
pref[i] = pref[i - 1] + pt[i - 1].Dist(pt[i]);
}
Point orig{(LD)0, (LD)0};
LD area = 0;
int fin = -1;
RE (i, n) {
function<bool(int)> Check = [&](int j) {
if (j > i + n - 1) { return false; }
LD used = pref[j] - pref[i];
LD rem = L - used;
LD long_ax = rem / 2;
assert(rem > pt[i].Dist(pt[j]) + kEps);
LD short_ax = sqrt(Sq(rem / 2) - Sq(pt[i].Dist(pt[j]) / 2));
LD rat = long_ax / short_ax;
Point M = (pt[i] + pt[j]) / 2;
Point OX = (pt[i] - M).Normalize();
Point OY = OX.Rotate(kPi / 2);
function<Point(Point)> Transform = [&](Point P) {
P = P - M;
return Point{OX.DotProd(P) / rat, OY.DotProd(P)};
};
function<Point(Point)> Back = [&](Point P) {
return M + OX * P.x * rat + OY * P.y;
};
Circle O = {orig, short_ax};
Line fi = {Transform(pt[i - 1]), Transform(pt[i])};
Line si = {Transform(pt[i]), Transform(pt[i + 1])};
Line fj = {Transform(pt[j - 1]), Transform(pt[j])};
Line sj = {Transform(pt[j]), Transform(pt[j + 1])};
function<LD(Line, LD)> GetX = [&](Line k, LD def) {
vector<Point> inters = Utils::InterCircleLine(O, k);
assert(SZ(inters) == 2);
//assert((inters[0].y > 0) + (inters[1].y > 0) == 1);
if (inters[0].y > kEps) { return inters[0].x; }
if (inters[1].y > kEps) { return inters[1].x; }
return def;
};
LD from = max(GetX(fi, -short_ax), GetX(fj, -short_ax));
LD to = min(GetX(si, short_ax), GetX(sj, short_ax));
debug(i, j, from, to);
if (from > to) { return false; }
LD alfa2 = acos(from / short_ax);
LD alfa1 = acos(to / short_ax);
LD alfa = alfa2 - alfa1;
assert(alfa >= -kEps);
LD odcinek = ((alfa - sin(alfa)) / 2) * Sq(short_ax);
Point B1 = Back({from, sqrt(Sq(short_ax) - Sq(from))});
Point B2 = Back({to, sqrt(Sq(short_ax) - Sq(to))});
debug(B1, B2);
area += odcinek * rat;
area += (B2.x - B1.x) * (B1.y + B2.y) / 2;
return true;
};
maxi(fin, i + 1);
int cnt_fails = 0;
int cnt_succs = 0;
while (1) {
if (Check(fin)) {
cnt_fails = 0;
cnt_succs++;
} else {
if (cnt_succs) {
fin--;
break;
}
cnt_fails++;
}
fin++;
if (cnt_fails == 3) {
fin -= 3;
}
}
}
cout<<area<<endl;
return 0;
}
aW50MzJfdCBtYWluKCkgewoKICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwogIGNvdXQgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uKDEwKTsKICBjZXJyIDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbigxMCk7CiAgY2luLnRpZSgwKTsKICAvL2RvdWJsZSBiZWdfY2xvY2sgPSAxLjAgKiBjbG9jaygpIC8gQ0xPQ0tTX1BFUl9TRUM7CiAgCiAgaW50IG4sIEw7CiAgY2luPj5uPj5MOwogIHZlY3RvcjxQb2ludD4gcHQ7CiAgUkUgKGksIG4pIHsKICAgIGludCB4LCB5OwogICAgY2luPj54Pj55OwogICAgcHQuUEIoeyhMRCl4LCAoTEQpeX0pOwogIH0KICByZXZlcnNlKEFMTChwdCkpOwogIFJFUCAodHIsIDIpIHsKICAgIFJFUCAoaSwgbikgewogICAgICBwdC5QQihwdFtpXSk7CiAgICB9CiAgfQogIHZlY3RvcjxMRD4gcHJlZigzICogbik7CiAgUkUgKGksIDMgKiBuIC0gMikgewogICAgcHJlZltpXSA9IHByZWZbaSAtIDFdICsgcHRbaSAtIDFdLkRpc3QocHRbaV0pOwogIH0KICBQb2ludCBvcmlneyhMRCkwLCAoTEQpMH07CiAgTEQgYXJlYSA9IDA7CiAgaW50IGZpbiA9IC0xOwogIFJFIChpLCBuKSB7CiAgICBmdW5jdGlvbjxib29sKGludCk+IENoZWNrID0gWyZdKGludCBqKSB7CiAgICAgIGlmIChqID4gaSArIG4gLSAxKSB7IHJldHVybiBmYWxzZTsgfQogICAgICBMRCB1c2VkID0gcHJlZltqXSAtIHByZWZbaV07CiAgICAgIExEIHJlbSA9IEwgLSB1c2VkOwogICAgICBMRCBsb25nX2F4ID0gcmVtIC8gMjsKICAgICAgYXNzZXJ0KHJlbSA+IHB0W2ldLkRpc3QocHRbal0pICsga0Vwcyk7CiAgICAgIExEIHNob3J0X2F4ID0gc3FydChTcShyZW0gLyAyKSAtIFNxKHB0W2ldLkRpc3QocHRbal0pIC8gMikpOwogICAgICBMRCByYXQgPSBsb25nX2F4IC8gc2hvcnRfYXg7CiAgICAgIFBvaW50IE0gPSAocHRbaV0gKyBwdFtqXSkgLyAyOwogICAgICBQb2ludCBPWCA9IChwdFtpXSAtIE0pLk5vcm1hbGl6ZSgpOwogICAgICBQb2ludCBPWSA9IE9YLlJvdGF0ZShrUGkgLyAyKTsKICAgICAgZnVuY3Rpb248UG9pbnQoUG9pbnQpPiBUcmFuc2Zvcm0gPSBbJl0oUG9pbnQgUCkgewogICAgICAgIFAgPSBQIC0gTTsKICAgICAgICByZXR1cm4gUG9pbnR7T1guRG90UHJvZChQKSAvIHJhdCwgT1kuRG90UHJvZChQKX07CiAgICAgIH07CiAgICAgIGZ1bmN0aW9uPFBvaW50KFBvaW50KT4gQmFjayA9IFsmXShQb2ludCBQKSB7CiAgICAgICAgcmV0dXJuIE0gKyBPWCAqIFAueCAqIHJhdCArIE9ZICogUC55OwogICAgICB9OwogICAgICBDaXJjbGUgTyA9IHtvcmlnLCBzaG9ydF9heH07CiAgICAgIExpbmUgZmkgPSB7VHJhbnNmb3JtKHB0W2kgLSAxXSksIFRyYW5zZm9ybShwdFtpX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sZmExOwogICAgICBhc3NlcnQoYWxmYSA+PSAta0Vwcyk7CiAgICAgIExEIG9kY2luZWsgPSAoKGFsZmEgLSBzaW4oYWxmYSkpIC8gMikgKiBTcShzaG9ydF9heCk7CiAgICAgIFBvaW50IEIxID0gQmFjayh7ZnJvbSwgc3FydChTcShzaG9ydF9heCkgLSBTcShmcm9tKSl9KTsKICAgICAgUG9pbnQgQjIgPSBCYWNrKHt0bywgc3FydChTcShzaG9ydF9heCkgLSBTcSh0bykpfSk7CiAgICAgIGRlYnVnKEIxLCBCMik7CiAgICAgIGFyZWEgKz0gb2RjaW5layAqIHJhdDsKICAgICAgYXJlYSArPSAoQjIueCAtIEIxLngpICogKEIxLnkgKyBCMi55KSAvIDI7CiAgICAgIHJldHVybiB0cnVlOwogICAgfTsKICAgIG1heGkoZmluLCBpICsgMSk7CiAgICBpbnQgY250X2ZhaWxzID0gMDsKICAgIGludCBjbnRfc3VjY3MgPSAwOwogICAgd2hpbGUgKDEpIHsKICAgICAgaWYgKENoZWNrKGZpbikpIHsKICAgICAgICBjbnRfZmFpbHMgPSAwOwogICAgICAgIGNudF9zdWNjcysrOwogICAgICB9IGVsc2UgewogICAgICAgIGlmIChjbnRfc3VjY3MpIHsKICAgICAgICAgIGZpbi0tOwogICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGNudF9mYWlscysrOwogICAgICB9CiAgICAgIGZpbisrOwogICAgICBpZiAoY250X2ZhaWxzID09IDMpIHsKICAgICAgICBmaW4gLT0gMzsKICAgICAgfQogICAgfQogIH0KICBjb3V0PDxhcmVhPDxlbmRsOwogIAogIAogIHJldHVybiAwOwp9