// AOJ 2034 Autocorrelation Function
// 2018.3.27 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define EPS 1e-6
#define EQ(a,b)  (fabs((a)-(b))<EPS)

// バッファ入力から整数値を得る
char buf[50], *p;
int in()
{
	int n = 0;
	if (*p == '-') {
		p++; while (*p >= '0') n = 10*n + (*p++ & 0xf);
		n = -n;
	} else while (*p >= '0') n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

double tbl[205]; int sz;
int n; double r;
int x[102], y[102]; double k[102];

double ff(double xx)
{
	int i;
	if (xx <= x[0] || x[n-1] <= xx) return 0.0;
	for (i = 0; !(x[i] <= xx && xx < x[i+1]); i++);
	return k[i]*(xx - x[i]) + y[i];
}

#define f(x) (ff(x)*ff(x+r))

int cmp(double *a, double *b) {
	if (EQ(*a, *b)) return 0;
	if (*a <= *b) return -1; return 1;
}

int uniq(double *a, int n)
{
	int i, j;
	
	for (i = 0, j = 1; j < n; j++) {
		while (j < n && EQ(a[j], a[i])) j++;
		if (j < n) if (++i != j) a[i] = a[j];
	}
	return i+1;
}

int main()
{
	int i;
	double a, b, c, fa, fb, fc, ans;

	while (fgets(p=buf, 50, stdin) && *p != '0') {
		sscanf(p, "%d%lf", &n, &r);
		sz = 0;	for (i = 0; i < n; i++) {
			fgets(p=buf, 50, stdin);
			tbl[sz++] = x[i] = in(), y[i] = in();
			tbl[sz++] = x[i] - r;
			if (i > 0) k[i-1] = ((double)(y[i]-y[i-1]))/(x[i]-x[i-1]);
		}
		k[n-1] = 0;
		qsort(tbl, sz, sizeof(tbl[0]), cmp);
		sz = uniq(tbl, sz) - 1;

		ans = 0;
		a = tbl[0], fa = f(a);
		for (i = 0; i < sz; i++) {
			b = tbl[i+1], c = 0.5*(a+b);
			fb = f(b), fc = f(c);
			ans += (fa + 4*fc + fb)*(b-a)/6;
			a = b, fa = fb;
        }
		printf("%.8lf\n", ans);
	}
	return 0;
}

