{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Lineland is a strange country. As the name suggests, it\u0027s shape (as seen from above) is just a straight line, rather than some two-dimensional shape. The landscape along this line is very mountainous, something which occasionally leads to some problems. One such problem now occurs: in this modern era the king wants to build an airport to stimulate the country\u0027s economy. Unfortunately, it\u0027s impossible for airplanes to land on steep airstrips, so a horizontal piece of land is needed. To accommodate for the larger airplanes, this strip needs to have length at least L.\r\u003cbr\u003e\r\u003cbr\u003eOver the years, the inhabitants of Lineland have become very proficient in flattening pieces of land. Given a piece a land, they can remove rock quickly. They don\u0027t want to add rock for that may lead to an unstable landing strip. To minimize the amount of effort, however, 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 needs to be removed is measured as the total area of land above the place where the landing strip is placed, rather than the volume (so in the Figure below, the amount of land removed is given by the lightly shaded area).\r\u003cbr\u003e\u003cdiv align\u003d\"center\"\u003e\u003cimg src\u003d\"CDN_BASE_URL/c3c353eca8b5728844113561a8abeb42?v\u003d1716122199\"\u003e\u003c/div\u003e\r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"One line with a positive number: the number of test cases (at most 25). Then for each test case:\u003cul\u003e\u003cli\u003eOne line with an integer N, 2 ≤ N ≤ 500, the number of points, and an integer L, 1 ≤ L ≤ 10 000, the necessary length to flatten.\u003c/li\u003e\u003cli\u003elines with two integers xi and yi with 0 ≤ xi, yi ≤ 10 000 describing the landscape of Lineland. The xi are in (strictly) ascending order. At position xi the height of the landscape is yi. Between two xi the landscape has constant slope. (So the landscape is piecewise linear). The difference between xN and x1 is greater than or equal to L.\u003c/li\u003e\u003c/ul\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line with the minimum amount of rock which must be removed in order to build the airport. The answer should be given as a floating point number with an absolute error of at most 10\u003csup\u003e−3\u003c/sup\u003e."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n3 5\r\n0 2\r\n4 2\r\n14 0\r\n4 3\r\n0 2\r\n2 0\r\n4 0\r\n5 3\r\n3 10\r\n10 2\r\n30 2\r\n35 7\r\n2 777\r\n222 333\r\n4444 5555\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.9000\r\n0.3750\r\n0.0000\r\n373362.4867\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}