#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

struct P {
  double x, y;
  bool f;
  P(double x, double y, bool f) : x(x), y(y), f(f) {}
};
bool operator<(const P &a, const P &b) {
  return a.x!=b.x?a.x<b.x : a.y<b.y;
}

double X[100];
double Y[100];
int n;

double func(double x) {
  if (x<=X[0] || x>=X[n-1]) return 0;
  int q = upper_bound(X, X+n, x) - X;
  int p = q-1;
  return (Y[q]-Y[p])/(X[q]-X[p])*(x-X[p])+Y[p];
}

int main() {
  double r;
  while(cin>>n>>r,n) {
    vector<P> v;
    REP(i, n) {
      cin >> X[i] >> Y[i];
      v.push_back(P(X[i], Y[i], 0));
      v.push_back(P(X[i]-r, Y[i], 1));
    }
    sort(ALL(v));
    double ans = 0;
    REP(i, v.size()-1) {
      double a = v[i].x;
      double b = v[i+1].x;
      double c = (a+b)/2;
      double fa = func(a)*func(a+r);
      double fb = func(b)*func(b+r);
      double fc = func(c)*func(c+r);
      ans += (b-a)/6*(fa+4*fc+fb);
    }
    printf("%.10f\n",ans);
  }
}