#include<iostream>
#include<complex>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

#define X real()
#define Y imag()

typedef long double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef vector<P> Pol;

const D INF = 1e40;
const D EPS = 1e-8;
const D PI = acos(-1);

int sig(D r) {return (r < -EPS) ? -1 : (r > EPS) ? 1 : 0;}
bool eq(D a, D b) {return abs(a - b) < EPS;}
bool near(P a, P b) {return abs(a - b) < EPS;}

// 内積
D dot(P a, P b) {return a.X * b.X + a.Y * b.Y;}
// 外積
D det(P a, P b) {return a.X * b.Y - a.Y * b.X;}

// 線分のベクトル
P vec(L a) {return a.second - a.first;}

// 線分abに対する点xの位置
enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
int ccw(L s, P p) {
  P a = vec(s);
  p -= s.first;
  D cr = det(a, p);
  if (eq(cr, 0)) {
    if (sig(dot(a, p)) < 0) return BACK;
    if (sig(norm(a) - norm(p)) < 0) return FRONT;
    return ON;
  }
  return (cr > 0) ? LEFT : RIGHT;
}

// 交差判定
bool iLL(L a, L b) {return !eq(det(vec(a), vec(b)), 0);}
bool iLS(L a, L b) {return sig(det(vec(a), b.first - a.first)) * sig(det(vec(a), b.second - a.first)) <= 0;}
bool iSS(L a, L b) {
  int cwa = ccw(a, b.first) | ccw(a, b.second);
  int cwb = ccw(b, a.first) | ccw(b, a.second);
  return ((cwa | cwb) & ON) || ((cwa & cwb) == (LEFT | RIGHT));
}

// 交点
P pLL(L a, L b) {return a.first + vec(a) * (det(vec(b), b.first - a.first) / det(vec(b), vec(a)));}

// 比較関数
namespace std {
  bool operator<(P a, P b) {return eq(a.X, b.X) ? a.Y < b.Y : a.X < b.X;}
}

// 多角形の内外判定 内部:1、周上:0、外部:-1
int sGP(Pol pol, P p) {
  int side = -1;
  rep (i, pol.size()) {
    P p0 = pol[i] - p, p1 = pol[(i + 1) % pol.size()] - p;
    if (sig(det(p0, p1)) == 0 && sig(dot(p0, p1)) <= 0) return 0;
    if (p0.Y > p1.Y) swap(p0, p1);
    if (sig(p0.Y) <= 0 && 0 < sig(p1.Y) && sig(det(p0, p1)) > 0) side *= -1;
  }
  return side;
}

// 線分をマージする
vector<L> merge(vector<L> s) {
  rep (i, s.size()) if (s[i].second < s[i].first) swap(s[i].first, s[i].second);
  sort(s.begin(), s.end());
  rep (i, s.size()) rep (j, i) if (iSS(s[i], s[j]) && !iLL(s[i], s[j])) {
    s[j].second = max(s[i].second, s[j].second);
    s.erase(s.begin() + i--);
    break;
  }
  return s;
}

// 線分アレンジメント 隣の点への辺のみを持つ
pair<vector<P>, vector<vector<int> > > sArr(vector<L> s) {
  s = merge(s);
  vector<P> vp;
  rep (i, s.size()) {
    vp.push_back(s[i].first);
    vp.push_back(s[i].second);
  }
  rep (i,s.size()) rep (j, i) if (iSS(s[i], s[j])) vp.push_back(pLL(s[i], s[j]));
  sort(vp.begin(), vp.end());
  vp.erase(unique(vp.begin(), vp.end(), near), vp.end());
  vector<vector<int> > g(vp.size());
  rep (i, s.size()) {
    vector<pair<D, int> > v;
    rep (j, vp.size()) if (ccw(s[i], vp[j]) == ON) v.push_back(make_pair(norm(vp[j] - s[i].first), j));
    sort(v.begin(), v.end());
    rep (j, v.size() - 1) {
      g[v[j + 1].second].push_back(v[j].second);
      g[v[j].second].push_back(v[j + 1].second);
    }
  }
  return make_pair(vp, g);
}

D dmPP(P a, P b) {return abs(a.X - b.X) + abs(a.Y - b.Y);}

D dmSP(L s, P p) {
  D res = min(dmPP(s.first, p), dmPP(s.second, p));
  L l = L(p, p + P(1, 0));
  if (iLS(l, s) && !eq(det(vec(l), vec(s)), 0)) {
    P pp = pLL(l, s);
    res = min(res, dmPP(p, pp));
  }
  l = L(p, p + P(0, 1));
  if (iLS(l, s) && !eq(det(vec(l), vec(s)), 0)) {
    P pp = pLL(l, s);
    res = min(res, dmPP(p, pp));
  }
  return res;
}

D dmSS(L a, L b) {return iSS(a, b) ? 0 : min(min(dmSP(a, b.first), dmSP(a, b.second)), min(dmSP(b, a.first), dmSP(b, a.second)));}

int dx[] = {1, 0, -1, 0, 1};
int dy[] = {0, 1, 0, -1, 0};

int main() {
  int n;
  D r;
  while (true) {
    cin >> n >> r;
    if (n == 0 && r == 0) break;
    Pol pol;
    rep (i, n) {
      P p;
      cin >> p.X >> p.Y;
      pol.push_back(p);
    }
    vector<L> segs;
    rep (i, n) rep (j, 4) segs.push_back(L(pol[i] + r * P(dx[j], dy[j]), pol[i] + r * P(dx[j + 1], dy[j + 1])));
    rep (i, n) rep (j, 4) segs.push_back(L(pol[i] + r * P(dx[j], dy[j]), pol[(i + 1) % n] + r * P(dx[j], dy[j])));
    pair<vector<P>, vector<vector<int> > > arr = sArr(segs);
    D res = 0;
    rep (i, arr.first.size()) {
      if (sGP(pol, arr.first[i]) <= 0) continue;
      rep (j, arr.second[i].size()) {
	L seg(arr.first[i], arr.first[arr.second[i][j]]);
	bool ok = true;
	rep (k, n) {
	  if (sig(r - dmSS(seg, L(pol[k], pol[(k + 1) % n]))) > 0) {
	    ok = false;
	    break;
	  }
	}
	if (ok) {
	  res += abs(vec(seg));
	}
      }
    }
    printf("%.12Lf\n", res / 2);
  }
  return 0;
}

Measured memory_bytes: 2072