#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <class T>
inline void umin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
inline void umax(T &x, T y) {
  x = x > y ? x : y;
}
mt19937 R(chrono::system_clock().now().time_since_epoch().count());
const int N = 1e6 + 11;
const double eps = 1e-6;
int n, k;
vector<double> h[N];
pair<int, int> a[N];
int sgn(int x) { return x > 0 ? 1 : -1; }
long long Cross(pair<int, int> a, pair<int, int> b) {
  return 1ll * a.first * b.second - 1ll * a.second * b.first;
}
long long Dot(pair<int, int> a, pair<int, int> b) {
  return 1ll * a.first * b.first + 1ll * a.second * b.second;
}
long long getlen(pair<int, int> a) {
  return 1ll * a.first * a.first + 1ll * a.second * a.second;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  double A = atan2(a.second, a.first), B = atan2(b.second, b.first);
  if (A > B + eps || B > A + eps) return A < B;
  return Cross(a, b) != 0 ? Cross(a, b) > 0 : getlen(a) < getlen(b);
}
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    heap;
vector<double> merge(vector<double> a, vector<double> b) {
  vector<double> res = {0};
  int A = 1, B = 1, x = 0;
  res.reserve(((int)a.size()) + ((int)b.size()) - 1);
  while (A < ((int)a.size()) || B < ((int)b.size())) {
    if (B >= ((int)b.size()) ||
        A < ((int)a.size()) && a[A] - a[A - 1] > b[B] - b[B - 1])
      res.push_back(res.back() + a[A] - a[A - 1]), A++;
    else
      res.push_back(res.back() + b[B] - b[B - 1]), B++;
  }
  return res;
}
int main() {
  read(n);
  read(k);
  int sz = 0;
  for (register int i = (1); i <= (n); i++) {
    read(a[i].first), read(a[i].second);
    if (a[i].first || a[i].second) a[++sz] = a[i];
  }
  assert(sz == n - 1);
  n = sz;
  int gs = k;
  sort(a + 1, a + n + 1, cmp);
  for (register int l = (1); l <= (n); l++) {
    int r = l;
    while (r + 1 <= n && Cross(a[l], a[r + 1]) == 0 && Dot(a[l], a[r + 1]) > 0)
      r++;
    double cur = 0;
    h[l].push_back(cur);
    static double cost[N], qz[N];
    for (register int k = (1); k <= (r - l + 1); k++)
      cost[k] = sqrt(getlen(a[r - k + 1])), qz[k] = qz[k - 1] + cost[k];
    int lo = 1, hi = r - l + 1;
    for (register int k = (1); k <= (r - l + 1); k++) {
      if (gs - 2 * k + 1 > 0)
        cur += cost[lo++] * (gs - 2 * k + 1);
      else {
        cur += cost[hi] * (gs - 2 * lo + 1) - 2 * (qz[r - l + 1] - qz[hi]);
        hi--;
      }
      h[l].push_back(cur);
    }
    heap.push(make_pair(((int)h[l].size()), l));
    l = r;
  }
  while (((int)heap.size()) >= 2) {
    int a = heap.top().second;
    heap.pop();
    int b = heap.top().second;
    heap.pop();
    h[a] = merge(h[a], h[b]);
    heap.push(make_pair(((int)h[a].size()), a));
  }
  auto q = h[heap.top().second];
  double res = max(gs < ((int)q.size()) ? q[gs] : 0, q[gs - 1]);
  printf("%.10lf\n", res);
  return 0;
}
