#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
long long rnd() {
  unsigned long long ans = 0;
  for (int i = (int)(0); i <= (int)(4); i++) ans = ans << 15 ^ rand();
  return ans % ((unsigned long long)1 << 63);
}
const int N = 500005;
pair<long long, long long> a[N];
double d[N], q[N];
pair<double, int> A[N];
bool vis[N];
int L[N], R[N], bel[N];
long long mul(pair<long long, long long> a, pair<long long, long long> b) {
  return (long long)a.first * b.second - (long long)a.second * b.first;
}
int half(pair<long long, long long> x) {
  return x.second < 0 || (x.second == 0 && x.first < 0);
}
long long dd(pair<long long, long long> a) {
  return a.first * a.first + a.second * a.second;
}
bool cmp(pair<long long, long long> A, pair<long long, long long> B) {
  int X = half(A), Y = half(B);
  return X == Y ? (mul(A, B) == 0 ? dd(A) < dd(B) : mul(A, B) > 0) : X < Y;
}
bool cm(pair<long long, long long> A, pair<long long, long long> B) {
  int X = half(A), Y = half(B);
  return X == Y ? mul(A, B) > 0 : X < Y;
}
bool equal(pair<long long, long long> a, pair<long long, long long> b) {
  return cm(a, b) == 0 && cm(b, a) == 0;
}
int main() {
  int n = read(), k = read();
  for (int i = (int)(1); i <= (int)(n); i++) {
    a[i].first = read();
    a[i].second = read();
    if (a[i] == make_pair((long long)0, (long long)0)) swap(a[i], a[1]);
  }
  sort(a + 2, a + n + 1, cmp);
  d[0] = -1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    d[i] = sqrt(a[i].first * a[i].first + a[i].second * a[i].second);
  }
  int dq = 1;
  L[1] = R[1] = 1;
  for (int i = 2; i <= n; i = R[dq] + 1) {
    dq++;
    R[dq] = i;
    while (R[dq] < n && equal(a[i], a[R[dq] + 1])) R[dq]++;
    for (int j = (int)(i); j <= (int)(R[dq]); j++) {
      L[dq] = i;
      bel[j] = dq;
    }
  }
  for (int i = (int)(1); i <= (int)(dq); i++) {
    for (int j = (int)(R[i]); j >= (int)(L[i]); j--) {
      A[j] = make_pair((k - 1 - (R[i] - j) * 2) * d[j], j);
    }
  }
  sort(A + 1, A + n + 1);
  reverse(A + 1, A + n + 1);
  double ans = 0;
  for (int i = (int)(1); i <= (int)(k); i++)
    if (A[i].first > 0 || (i == k && A[i].first == 0)) {
      ans += A[i].first;
      vis[A[i].second] = 1;
    } else {
      int top = 1, jb = 0;
      q[1] = d[1];
      for (int j = (int)(2); j <= (int)(n); j++)
        if (!vis[j]) {
          q[++top] = d[j];
          jb = R[bel[j]] - j;
        }
      int jj = i - 1 - jb, L = 0, R = top + 1;
      for (int j = (int)(i); j <= (int)(k); j++) {
        if (jb >= jj) {
          ans += q[++L] * (jj - (k - 1 - jj));
          jj++;
        } else {
          ans += q[--R] * ((k - 1 - jb) - jb);
          jb++;
        }
      }
      break;
    }
  printf("%.10f\n", (double)ans);
}
