#include #include #include #ifndef M_PI #define M_PI (3.1415926535897954) #endif #define EPSILON (1e-12) #define EQ(x,y) (fabs((x)-(y)) < EPSILON) #define NE(x,y) (fabs((x)-(y)) >= EPSILON) #define LT(x,y) (((x)-(y)) <= -EPSILON) #define LE(x,y) (((x)-(y)) < +EPSILON) #define GT(x,y) (((x)-(y)) >= +EPSILON) #define GE(x,y) (((x)-(y)) > -EPSILON) using namespace std; struct point_t { double x, y; }; bool operator <(const point_t &p1, const point_t &p2) { if(EQ(p1.y, p2.y)) return p1.x < p2.x; return p1.y < p2.y; } double dist2(const point_t &p1, const point_t &p2) { return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y); } int main(void) { int N; double L; while(cin >> N >> L) { if(N == 0 && L == 0.0) break; vector v(N); int k = 0; for(int i = 0; i < N; i++) { cin >> v[i].x >> v[i].y; if(v[i] < v[k]) k = i; } int s = k; double t = 0.0; double l = 0.0; while(true) { double pmin = 2.0 * M_PI; double dmax = 0.0; int kk = 0; for(int i = 0; i < N; i++) { if(i == k) continue; double p = atan2(v[i].y - v[k].y, v[i].x - v[k].x) - t; while(LT(p, 0.0)) p += 2.0 * M_PI; double d = dist2(v[i], v[k]); if(LT(p, pmin) || (EQ(p, pmin) && GT(d, dmax))) { kk = i; pmin = p; dmax = d; } } l += sqrt(dmax); t += pmin; if(kk == s) break; k = kk; } cout << floor(l + 2 * M_PI * L + .5) << endl; } return 0; }