Border Conflict

No attempts yetTime limit1sMemory limit128 MB

Problem

Irvanistan and Jikjikestan are two neighbouring countries that have fought several wars over their border. Tens of thousands of people died, and neither side ever accepted the border the other claimed.

The leaders who now run both countries have accepted a United Nations proposal to settle the dispute. The proposal is to build a shorter and simpler border that a fair computer program computes.

The current border PP is a set of non-crossing line segments, and each segment joins two border points. Call these points p0,p1,,pN1p_0, p_1, \dots, p_{N-1}. So PP consists exactly of the segments joining pip_i and pi+1p_{i+1} for every ii with 0i<N10 \le i < N-1.

The United Nations asks for a new border CC made of points c0,c1,,cKc_0, c_1, \dots, c_K with c0=p0c_0 = p_0 and cK=pN1c_K = p_{N-1}, subject to the two constraints below.

  1. Every point cic_i is one of p0,,pN1p_0, \dots, p_{N-1}. If ci=prc_i = p_r and ci+1=psc_{i+1} = p_s, then obviously s>rs > r.
  2. Every point pip_i is at distance at most DD from CC. The distance from pip_i to CC is the distance from pip_i to the closest point on CC. The segment drawn from pip_i to that closest point is always perpendicular to CC.

Find the shortest possible length of a new border CC that satisfies both constraints.

Input

The input holds several test cases. The first line of a test case contains the number of points NN (2N1002 \le N \le 100) and an integer DD (0D5000 \le D \le 500). Each of the next NN lines contains two integers xix_i and yiy_i (10000xi,yi10000-10000 \le x_i, y_i \le 10000), the coordinates of the point pip_i. The coordinates increase, that is, xi<xi+1x_i < x_{i+1} and yi<yi+1y_i < y_{i+1} for every ii. The input ends with a line that starts with 0.

Output

For each test case print one line with the shortest possible length of the new border, rounded to two digits after the decimal point. Always print both digits. No answer in the input data lies on a rounding boundary.