#include <bits/stdc++.h>
const int max_N = 1000005;
const int max_P = 100;
const long double eps = 1e-9;
int n, m, cnt;
long double R, C, T[max_N], l_pos[max_N], r_pos[max_N];
long double coef[max_N][3];
std::vector<std::pair<long double, int> > Vec;
int read() {
  char c = getchar();
  int ans = 0;
  bool flag = true;
  while (!isdigit(c)) flag &= (c != '-'), c = getchar();
  while (isdigit(c)) ans = ans * 10 + c - '0', c = getchar();
  return flag ? ans : -ans;
}
void Write(int x) {
  if (x < 10)
    putchar(x + '0');
  else
    Write(x / 10), putchar(x % 10 + '0');
}
int min(int x, int y) { return x < y ? x : y; }
int max(int x, int y) { return x > y ? x : y; }
long double min(long double x, long double y) { return x < y ? x : y; }
long double max(long double x, long double y) { return x > y ? x : y; }
long double sqr(long double x) { return x * x; }
struct vec {
  long double x, y;
  vec(long double x0 = 0, long double y0 = 0) : x(x0), y(y0) {}
  vec operator+(const vec b) const { return vec(x + b.x, y + b.y); }
  vec operator-(const vec b) const { return vec(x - b.x, y - b.y); }
  vec operator*(const long double b) const { return vec(x * b, y * b); }
  vec operator/(const long double b) const { return vec(x / b, y / b); }
  long double norm() { return sqrtl(sqr(x) + sqr(y)); }
  long double norm2() { return sqr(x) + sqr(y); }
} P[max_N];
long double mod(long double x, long double y) {
  x -= (long long)(x / y) * y;
  if (x < 0) x += y;
  return x;
}
vec walk(vec L, vec R, long double t) {
  return L + (R - L) * (t / (R - L).norm());
}
std::pair<long double, long double> calc(long double Y1, long double Y2,
                                         long double X1, long double X2) {
  std::pair<long double, long double> res;
  res.first = (Y2 - Y1) / (X2 - X1);
  return res.second = Y1 - X1 * res.first, res;
}
std::pair<long double, long double> solve_equation(long double A, long double B,
                                                   long double C) {
  long double delta = sqr(B) - 4 * A * C;
  delta = sqrtl(delta);
  return std::make_pair((-B - delta) / (2 * A), (-B + delta) / (2 * A));
}
long double calc(int id, long double key) {
  return coef[id][0] * sqr(key) + coef[id][1] * key + coef[id][2];
}
void prepare() {
  int p1 = 1, p2 = 1;
  long double t = 0;
  while (p2 < 2 * n && T[p2] < R) p2++;
  while (p1 <= n && p2 < 2 * n) {
    long double nxt = min(T[p1], T[p2] - R);
    if (nxt > t + eps) {
      ++cnt, l_pos[cnt] = t, r_pos[cnt] = nxt;
      vec X1 = walk(P[p1], P[p1 + 1], t - T[p1 - 1]),
          X2 = walk(P[p1], P[p1 + 1], nxt - T[p1 - 1]);
      vec Y1 = walk(P[p2], P[p2 + 1], t + R - T[p2 - 1]),
          Y2 = walk(P[p2], P[p2 + 1], nxt + R - T[p2 - 1]);
      std::pair<long double, long double> X =
          calc(Y1.x - X1.x, Y2.x - X2.x, t, nxt);
      std::pair<long double, long double> Y =
          calc(Y1.y - X1.y, Y2.y - X2.y, t, nxt);
      coef[cnt][0] = sqr(X.first) + sqr(Y.first);
      coef[cnt][1] = 2 * (X.first * X.second + Y.first * Y.second);
      coef[cnt][2] = sqr(X.second) + sqr(Y.second);
    }
    t = nxt;
    while (p1 <= n && T[p1] < t + eps) p1++;
    while (p2 < 2 * n && T[p2] - R < t + eps) p2++;
  }
}
void Delete(long double l, long double r) {
  if (r - l < eps) return;
  if (r - l > R - eps)
    l = -eps, r = R + eps;
  else
    l = mod(l, R), r = mod(r, R);
  if (l < r)
    Vec.push_back(std::make_pair(l - eps, -1)),
        Vec.push_back(std::make_pair(r + eps, 1));
  if (l > r)
    Vec.push_back(std::make_pair(-eps, -1)),
        Vec.push_back(std::make_pair(r + eps, 1)),
        Vec.push_back(std::make_pair(l - eps, -1)),
        Vec.push_back(std::make_pair(R + eps, 1));
}
bool check(long double x) {
  Vec.clear();
  Vec.reserve(4 * cnt);
  for (int i = 1; i <= cnt; coef[i][2] += x, i++) {
    coef[i][2] -= x;
    if (sqr(coef[i][1]) - 4 * coef[i][0] * coef[i][2] < 0)
      Delete(l_pos[i], r_pos[i]);
    else {
      std::pair<long double, long double> tmp =
          solve_equation(coef[i][0], coef[i][1], coef[i][2]);
      if (calc(i, l_pos[i]) > 0 && calc(i, r_pos[i]) > 0) {
        if (tmp.first > l_pos[i] && tmp.second < r_pos[i])
          Delete(l_pos[i], tmp.first), Delete(tmp.second, r_pos[i]);
        else
          Delete(l_pos[i], r_pos[i]);
      } else if (calc(i, l_pos[i]) > 0 && calc(i, r_pos[i]) < 0)
        Delete(l_pos[i], tmp.first);
      else if (calc(i, l_pos[i]) < 0 && calc(i, r_pos[i]) > 0)
        Delete(tmp.second, r_pos[i]);
    }
  }
  int sum = 0;
  std::sort(Vec.begin(), Vec.end());
  if (Vec.empty() || Vec[0].first > 0 || Vec.back().first < R) return true;
  for (int i = 0; i + 1 < Vec.size(); i++)
    if ((sum += Vec[i].second) >= 0) return true;
  return false;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++)
    scanf("%Lf%Lf", &P[i].x, &P[i].y), P[i + n] = P[i];
  for (int i = 1; i < 2 * n; i++) T[i] = T[i - 1] + (P[i + 1] - P[i]).norm();
  C = T[n], R = C / m;
  prepare();
  long double ml = 0, mr = R;
  for (int _ = 1; _ <= max_P; _++) {
    long double mid = (ml + mr) / 2;
    if (check(sqr(mid)))
      mr = mid;
    else
      ml = mid;
  }
  if ((ml + mr) / 2 < 0.5)
    printf("0");
  else
    printf("%.10Lf", (ml + mr) / 2);
  return 0;
}
