#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        double r;
        cin >> n >> r;
        if(n == 0)
            return 0;

        vector<double> x(n), y(n);
        for(int i=0; i<n; ++i)
            cin >> x[i] >> y[i];

        vector<double> s(n-1), t(n-1); // y = s * x + t
        for(int i=0; i<n-1; ++i){
            s[i] = (y[i+1] - y[i]) / (x[i+1] - x[i]);
            t[i] = y[i] - s[i] * x[i];
        }

        double ret = 0.0;
        for(int i=0; i<n-1; ++i){
            for(int j=0; j<n-1; ++j){
                double x1 = max(x[i], x[j] - r);
                double x2 = min(x[i+1], x[j+1] - r);
                if(x1 > x2)
                    continue;

                double s1 = s[i];
                double t1 = t[i];
                double s2 = s[j];
                double t2 = t[j] + s[j] * r;

                double a, b, c; // y = a * x^2 + b * x + c
                a = s1 * s2;
                b = s1 * t2 + s2 * t1;
                c = t1 * t2;
                
                ret += a / 3 * pow(x2, 3) + b / 2 * pow(x2, 2) + c * x2;
                ret -= a / 3 * pow(x1, 3) + b / 2 * pow(x1, 2) + c * x1;
            }
        }
        printf("%.10f\n", ret);
    }
}