#include <stdio.h>
#include <math.h>

#define MAXN    110000

long double x[2 * MAXN + 1];
long double y[2 * MAXN + 1];
long double eps = 1e-7;

long double hypot(long double x, long double y) {
    return sqrt(x * x + y * y);
}

long double min(long double x, long double y) {
    return (x < y) ? x : y;
}

long double calc(long double x1, long double y1, long double dx1, long double dy1, long double x2, long double y2, long double dx2, long double dy2, long double dt) {
    long double result = hypot(x1 - x2, y1 - y2);
    
    long double a = (dx1 - dx2) * (dx1 - dx2) + (dy1 - dy2) * (dy1 - dy2);
    if (fabs(a) < eps) {
        return result;
    }
    
    long double b = (dx1 - dx2) * (x1 - x2) + (dy1 - dy2) * (y1 - y2);
    long double c = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
    
    long double t = -b / a;
    if (t < 0 || t > dt) {
        return result;
    }
    
    if (fabs(c - b * b / a) < eps) {
        return min(result, 0);
    } else {
        return min(result, sqrt(c - b * b / a));
    }
}

int main() {
    freopen("trolleys.in", "r", stdin);
    freopen("trolleys.out", "w", stdout);

    int n, m;

    scanf("%d %d", &n, &m);
    for (int i = 0; i < n; i++) {
        scanf("%lf %lf", &x[i], &y[i]);
        x[i + n] = x[i];
        y[i + n] = y[i];
    }
    x[n + n] = x[0];
    y[n + n] = y[0];

    long double length = 0.0;
    for (int i = 0; i < n; i++) {
        length += hypot(x[i + 1] - x[i], y[i + 1] - y[i]);
    }
    long double L = length / m;

    int cur1 = 0;
    int cur2 = 0;
    long double leftDist1 = hypot(x[1] - x[0], y[1] - y[0]); 
    long double leftDist2 = L; 
    while (true) {
        long double dist = hypot(x[cur2 + 1] - x[cur2], y[cur2 + 1] - y[cur2]);
        if (dist > leftDist2) {
            leftDist2 = dist - leftDist2;
            break;
        }
        leftDist2 -= dist;
        cur2++;
    }
    
    long double result = 1e100; 
    while (cur1 < n) {
        long double dist = hypot(x[cur1 + 1] - x[cur1], y[cur1 + 1] - y[cur1]);
        long double dx1 = (x[cur1 + 1] - x[cur1]) / dist;
        long double dy1 = (y[cur1 + 1] - y[cur1]) / dist;
        long double x1 = x[cur1] + (dist - leftDist1) * dx1;
        long double y1 = y[cur1] + (dist - leftDist1) * dy1; 
        
        dist = hypot(x[cur2 + 1] - x[cur2], y[cur2 + 1] - y[cur2]);
        long double dx2 = (x[cur2 + 1] - x[cur2]) / dist;
        long double dy2 = (y[cur2 + 1] - y[cur2]) / dist;
        long double x2 = x[cur2] + (dist - leftDist2) * dx2;
        long double y2 = y[cur2] + (dist - leftDist2) * dy2; 
        
        long double dt = min(leftDist1, leftDist2);
        result = min(result, calc(x1, y1, dx1, dy1, x2, y2, dx2, dy2, dt));
        
        x1 = x1 + dt * dx1;
        y1 = y1 + dt * dy1;
        leftDist1 = leftDist1 - dt;
        x2 = x2 + dt * dx2;
        y2 = y2 + dt * dy2;
        leftDist2 = leftDist2 - dt;
        
        if (leftDist1 < eps) {
            cur1++;
            leftDist1 = hypot(x[cur1 + 1] - x[cur1], y[cur1 + 1] - y[cur1]);
        }
        
        if (leftDist2 < eps) {
            cur2++;
            leftDist2 = hypot(x[cur2 + 1] - x[cur2], y[cur2 + 1] - y[cur2]);
        }
    }

    printf("%.9lf\n", result);
}
