Lineland's Airport

Time limit2sMemory limit128 MB

Problem

Lineland is a strange country. As the name suggests, its shape as seen from above is just a straight line rather than a two-dimensional figure. The landscape along this line is very mountainous, which occasionally leads to problems. One such problem occurs now: in this modern era the king wants to build an airport to stimulate the country's economy. Unfortunately, airplanes cannot land on steep airstrips, so a horizontal piece of land is needed. To accommodate the larger airplanes, this strip must have length at least $L$.

Over the years, the inhabitants of Lineland have become very proficient at flattening pieces of land. Given a piece of land, they can remove rock quickly. They do not want to add rock, as that may lead to an unstable landing strip, so they can only lower the terrain, never raise it. To minimize their effort, they want to remove the least amount of rock necessary to reach their goal: a flat piece of land of length $L$. What is this minimum amount? Because of the low-dimensional nature of Lineland, the amount of rock that must be removed is measured as the total area of land lying above the place where the strip is placed — the shaded region above the airstrip in the cross-section — rather than as a volume.

Input

The first line contains a positive number of scenarios (at most $25$). Then, for each scenario:

  • One line with two integers $N$ and $L$: the number of points, $2 \le N \le 500$, and the required flat length, $1 \le L \le 10000$.
  • $N$ lines, each with two integers $x_i$ and $y_i$ with $0 \le x_i, y_i \le 10000$, describing the landscape. The $x_i$ are in strictly ascending order. At position $x_i$ the height of the landscape is $y_i$, and between two consecutive $x_i$ the landscape has constant slope (so the landscape is piecewise linear). It is guaranteed that $x_N - x_1 \ge L$.

Output

For each scenario, output one line with the minimum amount of rock that must be removed in order to build the airport. This value is uniquely determined. Print it rounded to four decimal places (for example, 0.9000); all test data is chosen so that this rounding is unambiguous.