#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int first = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) {
    if (ch == '-') f = -1;
  }
  for (; isdigit(ch); ch = getchar()) {
    first = first * 10 + ch - 48;
  }
  return first * f;
}
const int mxN = 5e5;
int n, m, nn;
pair<int, int> a[mxN + 3];
long double d[mxN + 3], w[mxN + 3];
int cnt[mxN + 3], p[mxN + 3], f[mxN + 3];
map<pair<int, int>, int> id;
vector<int> vec[mxN + 3];
bool cmp_dis(int first, int second) { return d[first] < d[second]; }
bool cmp_cnt(int first, int second) {
  return cnt[first] * d[first] > cnt[second] * d[second];
}
int gcd(int first, int second) {
  return second == 0 ? first : gcd(second, first % second);
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) {
    a[i].first = read(), a[i].second = read();
    d[i] =
        sqrt(1.0 * a[i].first * a[i].first + 1.0 * a[i].second * a[i].second);
    int g = gcd(abs(a[i].first), abs(a[i].second));
    if (g == 0) {
      continue;
    }
    pair<int, int> tmp = make_pair(a[i].first / g, a[i].second / g);
    if (!id[tmp]) {
      id[tmp] = ++nn;
    }
    vec[id[tmp]].push_back(i);
  }
  for (int i = 1; i <= nn; i++) {
    sort(vec[i].begin(), vec[i].end(), cmp_dis);
    for (int j = 0; j < vec[i].size(); j++) {
      cnt[vec[i][j]] = vec[i].size() - 1 - j;
    }
  }
  for (int i = 1; i <= n; i++) {
    w[i] = d[i] * (m - 1 - 2 * cnt[i]);
  }
  sort(w + 1, w + n + 1);
  long double ans = 0.0;
  for (int i = n; i > n - m; i--) {
    ans += w[i];
  }
  int mx = 0;
  for (int i = 1; i <= nn; i++) {
    if (vec[i].size() >= n - (m + 1) / 2) {
      mx = i;
      break;
    }
  }
  if (mx) {
    long double ans2 = 0.0;
    int tot = m - 1;
    for (int i = 1; i <= nn; i++) {
      if (i != mx) {
        for (int j = vec[i].size() - 1, first = 0; j >= 0; j--) {
          int u = vec[i][j];
          ans2 += d[u] * (m - 1 - 2 * first);
          first++;
          tot--;
        }
      }
    }
    int first = 0;
    for (int j = vec[mx].size() - 1; first < m / 2; j--) {
      int u = vec[mx][j];
      ans2 += d[u] * (m - 1 - 2 * first);
      first++;
      tot--;
    }
    for (int j = tot - 1; j >= 0; j--) {
      int u = vec[mx][j];
      ans2 += d[u] * (m - 1 - 2 * first);
      first++;
      tot--;
    }
    ans = max(ans, ans2);
  }
  printf("%.12Lf\n", ans);
  return 0;
}
