#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;}

// テァツキツ堙・ツ按?bテ」ツ?ォテ・ツッツセテ」ツ?凖」ツつ凝ァツつケ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());
  vector<bool> flag;
  rep (i, s.size()) flag.push_back(true);
  rep (i, s.size()) if (flag[i]) rep (j, i) if (flag[j]) {
    if (iSS(s[i], s[j]) && !iLL(s[i], s[j])) {
      s[j].second = s[i].second;
      flag[i] = false;
      break;
    }
  }
  vector<L> segs;
  rep (i, s.size()) if (flag[i]) segs.push_back(s[i]);
  return segs;
}

// テァツキツ堙・ツ按?」ツつ「テ」ツδャテ」ツδウテ」ツつクテ」ツδ。テ」ツδウテ」ツδ?テゥツ堋」テ」ツ?ョテァツつケテ」ツ?クテ」ツ?ョティツセツコテ」ツ?ョテ」ツ?ソテ」ツつ津ヲツ個?」ツ?、
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: 2080