#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long su = 0, f = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) su = su * 10 + c - '0';
  return su * f;
}
inline void wr(long long x) {
  if (x < 0)
    putchar('-'), wr(-x);
  else {
    if (x >= 10) wr(x / 10);
    putchar(x % 10 + '0');
  }
}
inline void wri(long long x) {
  wr(x);
  putchar(' ');
}
inline void wrn(long long x) {
  wr(x);
  putchar('\n');
}
inline void wrn(long long x, long long y) {
  wri(x);
  wrn(y);
}
inline void wrn(long long x, long long y, long long z) {
  wri(x);
  wrn(y, z);
}
long long n, m, tot, k;
struct po {
  long long x, y, p;
  void ge() {
    if ((y < 0) || (y == 0 && x < 0))
      p = 0;
    else
      p = 1;
  }
  void rd() {
    x = read();
    y = read();
    ge();
  }
  long double dis() { return sqrt(1ll * x * x + 1ll * y * y); }
} z[2500055];
long double b[2500055], c[2500055], ans;
long long operator*(po a, po b) { return 1ll * a.x * b.y - 1ll * a.y * b.x; }
long long sj(po a, po b) { return 1ll * a.x * b.x + 1ll * a.y * b.y; }
bool cmp(po a, po b) {
  return (a.p == b.p) ? ((a * b == 0) ? a.dis() < b.dis() : a * b < 0)
                      : (a.p < b.p);
}
void solve(long long l, long long r) {
  for (long long i = l; i <= r; i++) b[i - l + 1] = z[i].dis();
  long long m = r - l + 1;
  sort(b + 1, b + m + 1);
  l = 1;
  r = m;
  long double s = 0;
  for (long long i = 1; i <= m; i++) {
    if (k - i - i + 1 >= 0) {
      c[++tot] = b[r] * (k - i - i + 1);
      r--;
    } else {
      long long t = k - i - i + 1;
      if (t < -2) t = (t % 2 == 0) ? -2 : -1;
      c[++tot] = b[l] * t - s * 2;
      s += b[l];
      l++;
    }
  }
}
signed main() {
  n = read();
  k = read();
  for (long long i = 1; i <= n; i++) z[i].rd();
  for (long long i = 1; i < n; i++)
    if (z[i].x == 0 && z[i].y == 0) swap(z[i], z[n]);
  sort(z + 1, z + n, cmp);
  long long t = 1;
  for (long long i = 2; i < n; i++) {
    if (z[i] * z[i - 1] != 0 || sj(z[i], z[i - 1]) < 0) {
      solve(t, i - 1);
      t = i;
    }
  }
  solve(t, n - 1);
  c[++tot] = 0;
  sort(c + 1, c + tot + 1);
  reverse(c + 1, c + tot + 1);
  for (long long i = 1; i <= k; i++) ans += c[i];
  double an2 = ans;
  printf("%.8lf", an2);
  return 0;
}
