#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1, c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f == 1 ? x : -x;
}
const int N = 5e5 + 4;
int gcd(int x, int y) { return (!x || !y) ? (x | y) : gcd(y, x % y); }
struct poin {
  int x, y;
  poin() {}
  poin(int xx, int yy) : x(xx), y(yy) {}
} a[N];
inline bool comp(const poin &a, const poin &b) {
  return abs(a.x) < abs(b.x) || (abs(a.x) == abs(b.x) && abs(a.y) < abs(b.y));
}
inline double sqr(double x) { return x * x; }
inline double distan(const poin &a, const poin &b) {
  return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y));
}
map<pair<int, int>, int> mp;
vector<int> vec[N];
int n, k, tot, m = 1;
double ans, sd[N], dis[N], b[N];
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) {
    a[i].x = read();
    a[i].y = read();
  }
  sort(a + 1, a + n + 1, comp);
  for (int i = 2, d, x, y; i <= n; i++) {
    d = gcd(abs(a[i].x), abs(a[i].y));
    x = a[i].x / d;
    y = a[i].y / d;
    if (!mp.count(make_pair(x, y))) mp[make_pair(x, y)] = ++tot;
    vec[mp[make_pair(x, y)]].push_back(i);
  }
  for (int t = 1, len, c3, c4; t <= tot; t++) {
    len = vec[t].size();
    poin pre(0, 0);
    double sum = 0, sum2 = 0, sum3 = 0, sum4 = 0;
    c3 = c4 = 0;
    for (int i = 0; i < len; i++) {
      sd[i + 1] = sd[i] + distan(a[vec[t][i]], pre);
      pre = a[vec[t][i]];
    }
    for (int i = 1; i <= min(len, k >> 1); i++) {
      sum += sd[len - i + 1];
      sum2 += sum3 - sd[len - i + 1] * c3;
      sum3 += sd[len - i + 1];
      c3++;
      dis[i] = sum * (k - i) + sum2;
    }
    for (int i = (k >> 1) + 1; i <= len; i++) {
      sum += sd[i - (k >> 1)];
      sum2 += sum3 + sd[i - (k >> 1)] * (c4 - c3) - sum4;
      sum4 += sd[i - (k >> 1)];
      c4++;
      dis[i] = sum * (k - i) + sum2;
    }
    for (int i = len; i; i--) b[++m] = dis[i] - dis[i - 1];
  }
  sort(b + 1, b + m + 1);
  reverse(b + 1, b + m + 1);
  for (int i = 1; i <= k; i++) ans += b[i];
  printf("%.8lf\n", ans);
  return (0 - 0);
}
