// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<complex>

#include<algorithm>



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



using namespace std;



typedef complex<double> Point;



const double EPS=1e-9;



namespace std{

	bool operator <(const Point &a,const Point &b){

		return abs(a.real()-b.real())<EPS?(a.imag()+EPS<b.imag()):(a.real()+EPS<b.real());

	}

}



class Line:public vector<Point>{

public:

	Line(){}

	Line(const Point &a,const Point &b){ push_back(a), push_back(b); }

};



class Segment:public Line{

public:

	Segment(){}

	Segment(const Point &a,const Point &b):Line(a,b){}

};



inline double dot(const Point &a,const Point &b){

	return a.real()*b.real()+a.imag()*b.imag();

}



inline double cross(const Point &a,const Point &b){

	return a.real()*b.imag()-a.imag()*b.real();

}



enum {CCW=1,CW=-1,ON=0};

int ccw(const Point &a,Point b,Point c){

	b-=a, c-=a;

	double rotdir=cross(b,c);

	if(rotdir>EPS)  return CCW;

	if(rotdir<-EPS) return CW;

	return ON;

}



inline void calc_abc(const Line &l,double &a,double &b,double &c){

	a=l[0].imag()-l[1].imag();

	b=l[1].real()-l[0].real();

	c=cross(l[0],l[1]);

}



bool cover(const Segment &s,const Point &p){

	return dot(s[0]-p,s[1]-p)<EPS;

}



bool intersect(const Segment &s,const Segment &t,Point *p){

	bool flg;

	if(abs(cross(s[1]-s[0],t[1]-t[0]))<EPS && abs(cross(s[1]-s[0],t[0]-s[0]))<EPS){

		flg=(cover(s,t[0]) || cover(s,t[1]) || cover(t,s[0]) || cover(t,s[1]));

		if(!flg) return false;

	}



	if(flg || (ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1])<=0

			&& ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1])<=0)){

		double a1,b1,c1,a2,b2,c2;

		calc_abc(s,a1,b1,c1);

		calc_abc(t,a2,b2,c2);

		double det=a1*b2-a2*b1;

		if(abs(det)<EPS){ // s is parallel to t

			Point q[3]={s[0],s[1],t[0]};

			rep(i,3){

				if(cover(s,q[i]) && cover(t,q[i])){

					*p=q[i];

					break;

				}

			}

		}

		else *p=Point(b1*c2-b2*c1,a2*c1-a1*c2)/det;

		return true;

	}

	return false;

}



int n;

Point _f[100],_g[100];



double f(double x){

	if(x<_f[0].real()) return 0;

	rep(i,n-1){

		double x1=_f[i].real(),x2=_f[i+1].real();

		double y1=_f[i].imag(),y2=_f[i+1].imag();

		if(x<x2) return (y2-y1)/(x2-x1)*(x-x1)+y1;

	}

	return 0;

}



double g(double x){

	if(x<_g[0].real()) return 0;

	rep(i,n-1){

		double x1=_g[i].real(),x2=_g[i+1].real();

		double y1=_g[i].imag(),y2=_g[i+1].imag();

		if(x<x2) return (y2-y1)/(x2-x1)*(x-x1)+y1;

	}

	return 0;

}



int main(){

	for(double r;scanf("%d%lf",&n,&r),n;){

		vector<double> ev;

		rep(i,n){

			int x,y; scanf("%d%d",&x,&y);

			_f[i]=Point(x,y);

			_g[i]=Point(x+r,y);

			ev.push_back(x);

			ev.push_back(x+r);

		}



		rep(i,n-1) rep(j,n-1) {

			Point p;

			if(intersect(Segment(_f[i],_f[i+1]),Segment(_g[i],_g[i+1]),&p)){

				ev.push_back(p.real());

			}

		}



		sort(_f,_f+n);

		sort(_g,_g+n);

		sort(ev.begin(),ev.end());



		double ans=0;

		rep(i,ev.size()-1){

			double x1=ev[i],x2=ev[i+1];

			if(x2-x1<EPS) continue;

			double f1=f(x1),f2=f(x2),g1=g(x1),g2=g(x2);

			double af=(f2-f1)/(x2-x1),bf=f1-af*x1;

			double ag=(g2-g1)/(x2-x1),bg=g1-ag*x1;

			ans+=af*ag*(x2*x2*x2-x1*x1*x1)/3+(af*bg+bf*ag)*(x2*x2-x1*x1)/2+bf*bg*(x2-x1);

		}

		printf("%.15f\n",ans);

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.569775651878949x):
#include<cstdio>

#include<algorithm>



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



using namespace std;



const double EPS=1e-9;



struct Point{ double x,y; };



int n;

Point _f[100],_g[100];



double f(double x){

	if(x<_f[0].x) return 0;

	rep(i,n-1){

		double x1=_f[i].x,x2=_f[i+1].x;

		double y1=_f[i].y,y2=_f[i+1].y;

		if(x<x2) return (y2-y1)/(x2-x1)*(x-x1)+y1;

	}

	return 0;

}



double g(double x){

	if(x<_g[0].x) return 0;

	rep(i,n-1){

		double x1=_g[i].x,x2=_g[i+1].x;

		double y1=_g[i].y,y2=_g[i+1].y;

		if(x<x2) return (y2-y1)/(x2-x1)*(x-x1)+y1;

	}

	return 0;

}



int main(){

	for(double r;scanf("%d%lf",&n,&r),n;){

		double ev[200];

		rep(i,n){

			int x,y; scanf("%d%d",&x,&y);

			_f[i]=(Point){x,y};

			_g[i]=(Point){x+r,y};

			ev[2*i+0]=x;

			ev[2*i+1]=x+r;

		}

		sort(ev,ev+2*n);



		double ans=0;

		rep(i,2*n-1){

			double x1=ev[i],x2=ev[i+1];

			if(x2-x1<EPS) continue;



			double f1=f(x1),f2=f(x2),g1=g(x1),g2=g(x2);

			double af=(f2-f1)/(x2-x1),bf=f1-af*x1;

			double ag=(g2-g1)/(x2-x1),bg=g1-ag*x1;

			ans+=af*ag*(x2*x2*x2-x1*x1*x1)/3+(af*bg+bf*ag)*(x2*x2-x1*x1)/2+bf*bg*(x2-x1);

		}

		printf("%.15f\n",ans);

	}



	return 0;

}