#include <bits/stdc++.h>
using std::pair;
using std::string;
using std::vector;
template <typename T>
bool chkmax(T& a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
bool chkmin(T& a, T b) {
  return a > b ? a = b, 1 : 0;
}
const int N = 100000;
const int oo = 0x3f3f3f3f;
template <typename T>
T read(T& x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
  return x *= f;
}
const double eps = 1e-9;
typedef struct Point {
  double x, y;
  Point() {}
  Point(double x_, double y_) : x(x_), y(y_) {}
} Vector;
Point operator-(const Point& a, const Point& b) {
  return Point(a.x - b.x, a.y - b.y);
}
Point operator+(const Point& a, const Point& b) {
  return Point(a.x + b.x, a.y + b.y);
}
Point operator*(const Point& a, const double& b) {
  return Point(a.x * b, a.y * b);
}
Point operator/(const Point& a, const double& b) {
  return Point(a.x / b, a.y / b);
}
double dot(const Point& a, const Point& b) { return a.x * b.x + a.y * b.y; }
double len(const Point& a) { return sqrt(dot(a, a)); }
Point unit(const Point& a) { return a / len(a); }
double T;
int n, m;
Point p[N + 5];
int dcmp(double x) { return (x > -eps) - (x < eps); }
vector<pair<double, double> > solve(double a, double b, double c) {
  static vector<pair<double, double> > res;
  res.clear();
  if (dcmp(a) == 0) {
    if (dcmp(b) == 0) {
      if (dcmp(c) <= 0) {
        res.push_back(std::make_pair(-1e9, 1e9));
      }
      return res;
    }
    if (dcmp(b) > 0) {
      res.push_back(std::make_pair(-1e9, -c / b));
    } else {
      res.push_back(std::make_pair(-c / b, 1e9));
    }
    return res;
  }
  double delta = b * b - 4 * a * c;
  if (dcmp(delta) < 0) {
    if (dcmp(a) < 0) {
      res.push_back(std::make_pair(-1e9, 1e9));
    }
    return res;
  }
  double x0 = (-b - sqrt(delta)) / (2 * a), x1 = (-b + sqrt(delta)) / (2 * a);
  if (x0 > x1) std::swap(x0, x1);
  if (dcmp(a) > 0) {
    res.push_back(std::make_pair(x0, x1));
  } else {
    res.push_back(std::make_pair(-1e9, x0));
    res.push_back(std::make_pair(x1, 1e9));
  }
  return res;
}
vector<pair<double, double> > range;
void get_range(double l) {
  range.clear();
  double t = T / m;
  pair<int, double> a = std::make_pair(0, len(p[1] - p[0])), b;
  for (int i = 0; i < n; ++i) {
    double l_ = len(p[((i + 1) % n)] - p[i]);
    if (l_ < t)
      t -= l_;
    else {
      b = std::make_pair(i, l_ - t);
      break;
    }
  }
  t = 0;
  while (a.first < n) {
    Point va = unit(p[((a.first + 1) % n)] - p[a.first]);
    Point vb = unit(p[((b.first + 1) % n)] - p[b.first]);
    Point pa = p[((a.first + 1) % n)] +
               unit(p[a.first] - p[((a.first + 1) % n)]) * a.second;
    Point pb = p[((b.first + 1) % n)] +
               unit(p[b.first] - p[((b.first + 1) % n)]) * b.second;
    double d = std::min(a.second, b.second);
    a.second -= d, b.second -= d;
    if (!dcmp(a.second))
      a.first = a.first + 1,
      a.second = len(p[((a.first + 1) % n)] - p[a.first]);
    if (!dcmp(b.second))
      b.first = ((b.first + 1) % n),
      b.second = len(p[((b.first + 1) % n)] - p[b.first]);
    static vector<pair<double, double> > sol;
    sol = solve(dot(va - vb, va - vb), 2. * dot(pa - pb, va - vb),
                dot(pa - pb, pa - pb) - l * l);
    for (int i = 0; i < int(sol.size()); ++i) {
      pair<double, double> tmp = sol[i];
      chkmax(tmp.first, 0.);
      chkmin(tmp.second, d);
      if (tmp.first <= tmp.second) {
        range.push_back(std::make_pair(tmp.first + t, tmp.second + t));
      }
    }
    t += d;
  }
}
bool chk(double l) {
  get_range(l);
  static vector<pair<double, double> > can;
  static vector<double> pos;
  for (int i = 1; i < int(range.size()); ++i) {
    if (range[i].first < range[i - 1].second + 1e-6) range[i].first += 1e-6;
  }
  vector<pair<double, double> >::iterator it = range.begin();
  can.clear();
  pos.clear();
  for (int i = 1; i <= m; ++i) {
    double L = (i - 1) * T / m, R = i * T / m;
    for (; it != range.end() && (*it).first <= i * T / m;) {
      double x = std::max((*it).first, L);
      double y = std::min((*it).second, R);
      can.push_back(std::make_pair(x - L, y - L));
      pos.push_back(x - L), pos.push_back(y - L);
      if ((*it).second <= i * T / m + eps)
        ++it;
      else
        break;
    }
  }
  static int cnt;
  cnt = 0;
  static double q[N * 4 + 5];
  std::sort(pos.begin(), pos.end());
  std::sort(can.begin(), can.end());
  it = can.begin();
  for (int i = 0; i < int(pos.size()); ++i) {
    while (it != can.end() && (*it).first <= pos[i]) {
      q[cnt++] = (*it).second;
      ++it;
      std::push_heap(q, q + cnt, std::greater<double>());
    }
    while (cnt && q[0] < pos[i]) {
      std::pop_heap(q, q + (cnt--), std::greater<double>());
    }
    if (cnt >= m) return true;
  }
  return false;
}
int main() {
  read(n), read(m);
  for (int i = 0; i < n; ++i) {
    static int x, y;
    read(x), read(y);
    p[i] = Point(x, y);
  }
  for (int i = 0; i < n; ++i) T += len(p[((i + 1) % n)] - p[i]);
  int TIMES = 50;
  double l = 0, r = 4000;
  for (; TIMES--;) {
    double mid = (l + r) / 2.0;
    if (chk(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.10lf\n", r);
  return 0;
}
