#include <bits/stdc++.h>
using namespace std;
long long ksm(long long a, long long b) {
  if (!b) return 1;
  long long ns = ksm(a, b >> 1);
  ns = ns * ns % 998244353;
  if (b & 1) ns = ns * a % 998244353;
  return ns;
}
int calc(pair<int, long long> a) {
  if (a.first == 0 && a.second == 0) return 0;
  if (a.first > 0 && a.second >= 0) return 1;
  if (a.first <= 0 && a.second > 0) return 2;
  if (a.first < 0 && a.second <= 0) return 3;
  if (a.first >= 0 && a.second < 0) return 4;
}
bool cmp(pair<int, long long> a, pair<int, long long> b) {
  if (calc(a) != calc(b)) return calc(a) < calc(b);
  return 1ll * a.first * b.second < 1ll * a.second * b.first;
}
struct th {
  pair<int, long long> dir;
  double len;
  bool operator<(const th &r) const {
    if (cmp(dir, r.dir)) return 1;
    if (cmp(r.dir, dir)) return 0;
    return len < r.len;
  }
} q[500010];
double w[500010];
const double eps = 1e-10;
multiset<double> r;
double cur[500010];
double inr[500010];
double sm[500010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    q[i].dir = make_pair(x, y);
    q[i].len = sqrt(1ll * x * x + 1ll * y * y);
  }
  sort(q + 1, q + n + 1);
  for (int i = 1; i <= n;) {
    int j = i;
    while (j <= n && !cmp(q[i].dir, q[j].dir)) j++;
    for (int s = j - 1; s >= i; s--) {
      int cs = (j - 1 - s);
      int tr = (k - 1) - 2 * cs;
      w[s] = q[s].len * tr;
      r.insert(w[s]);
    }
    i = j;
  }
  multiset<double>::iterator h = --r.end();
  double ans = 0;
  for (int j = 1; j <= k; j++) ans += (*h), h--;
  for (int i = 1; i <= n;) {
    int j = i;
    while (j <= n && !cmp(q[i].dir, q[j].dir)) j++;
    if (j - i >= k / 2 + 1) {
      int cnt = 0;
      for (int s = i; s < j; s++)
        cur[++cnt] = q[s].len, r.erase(r.lower_bound(w[s] - eps));
      int rc = 0;
      multiset<double>::iterator q = r.end();
      for (int s = 0; s < k && q != r.begin(); s++) {
        q--;
        inr[++rc] = *q;
      }
      for (int j = 1; j <= rc; j++) sm[j] = sm[j - 1] + inr[j];
      int lt = 0, rt = cnt + 1;
      int cs = 0;
      double tot = 0, ftot = 0;
      while (cs < cnt && cs < k) {
        int rd = (cnt - rt + 1);
        if (rd < k / 2) {
          rt--;
          tot += cur[rt] * (k - 1 - rd * 2);
        } else {
          lt++;
          tot += cur[lt] * (k - 1 - rd * 2) - 2 * ftot;
          ftot += cur[lt];
        }
        cs++;
        if (k - cs <= rc) {
          double nans = tot + sm[k - cs];
          ans = max(ans, nans);
        }
      }
      for (int s = i; s < j; s++) r.insert(w[s]);
    }
    i = j;
  }
  printf("%.20lf\n", ans);
  return 0;
}
