#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using namespace std;
using R=long double;
const R eps=1e-11; // [-1000:1000]->EPS=1e-8 [-10000:10000]->EPS=1e-7
const R pi=acos(-1);
const R inf=1e40;
inline int sgn(const R& r){ return (r > eps) - (r < -eps);}
inline int sgn(const R& a, const R &b){ return sgn(a-b); }
inline R sq(R x){return sqrt(max<R>(x,0.0));}

int n;
R vx[110],vy[110],r;

R val(R x){
	R ret=0.0;
	rep(i,n-1){
		if(vx[i]<=x&&x<vx[i+1]){
			R rate=(x-vx[i])/(vx[i+1]-vx[i]);
			ret=vy[i]+rate*(vy[i+1]-vy[i]);
			return ret;
		}
	}
	return ret;
}

R func(R x){ return 1.0*val(x)*val(x+r); }

int main(void){
	while(cin >> n >> r,n){	
		vector<R> ary;
		rep(i,n) cin >> vx[i] >> vy[i];
		rep(i,n) ary.push_back(vx[i]),ary.push_back(vx[i]+r),ary.push_back(vx[i]-r);
		
		uniq(ary);
		int m=ary.size();

		R ans=0.0;
		rep(i,m-1){
			R a=ary[i],b=ary[i+1],c=(a+b)/2.0;
			R fa=func(a),fb=func(b),fc=func(c);
			R cur=(fa+4.0*fc+fb)*(b-a)/6.0;
			ans+=cur;
		}
		cout.precision(20);
		cout << fixed << ans << endl;
	}
	return 0;
}