#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[500000];
int quad(pair<int, int> p) {
  if ((p.first > 0) && (p.second >= 0))
    return 0;
  else if ((p.second > 0) && (p.first <= 0))
    return 1;
  else if ((p.first < 0) && (p.second <= 0))
    return 2;
  else
    return 3;
}
bool comp(pair<int, int> a, pair<int, int> b) {
  if (a == make_pair(0, 0))
    return (b == make_pair(0, 0)) ? 0 : 1;
  else if (b == make_pair(0, 0))
    return 0;
  int qa = quad(a), qb = quad(b);
  if (qa != qb)
    return qa < qb;
  else
    return (long long int)a.first * b.second >
           (long long int)a.second * b.first;
}
vector<double> vv[500000];
vector<pair<double, pair<int, int> > > vvv;
int num[500000];
int main() {
  int i;
  int n, k;
  scanf("%d %d", &n, &k);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &p[i].first, &p[i].second);
  }
  sort(p, p + n, comp);
  int j, c = 0;
  for (i = 1; i < n; i++) {
    vv[c].push_back(sqrt((long long int)p[i].first * p[i].first +
                         (long long int)p[i].second * p[i].second));
    if ((i == n - 1) || comp(p[i], p[i + 1])) c++;
  }
  double ans = 0;
  for (i = 0; i < c; i++) sort(vv[i].begin(), vv[i].end(), greater<double>());
  if (k == n) {
    for (i = 0; i < c; i++) {
      for (j = 0; j < vv[i].size(); j++) {
        double d = vv[i][j] - ((j == vv[i].size() - 1) ? 0 : vv[i][j + 1]);
        int e = j + 1;
        ans += d * e * (k - e);
      }
    }
    printf("%.8lf\n", ans);
    return 0;
  }
  for (i = 0; i < c; i++) {
    ;
    for (j = 0; j < vv[i].size(); j++)
      vvv.push_back(make_pair(vv[i][j] * (k - 1 - 2 * j), make_pair(i, j)));
  }
  sort(vvv.begin(), vvv.end()), reverse(vvv.begin(), vvv.end());
  for (i = 0; i < k; i++) num[vvv[i].second.first]++;
  for (i = 0; i < c; i++) {
    for (j = 0; j < vv[i].size(); j++) {
      double d = vv[i][j] - ((j == vv[i].size() - 1) ? 0 : vv[i][j + 1]);
      int e = min(j + 1, num[i]);
      ans += d * e * (k - e);
    }
  }
  double sum = 0;
  for (i = 0; i < c; i++) {
    for (j = 0; j < vv[i].size(); j++) {
      double d = vv[i][j] - ((j == vv[i].size() - 1) ? 0 : vv[i][j + 1]);
      int e = min(j + 1, k);
      sum += (d * e) * (k - e);
    }
  }
  for (i = 0; i < c; i++) {
    if ((n - vv[i].size() <= k / 2) && (vv[i].size() >= (k + 1) / 2)) {
      double sum2 = sum;
      for (j = 0; j < vv[i].size(); j++) {
        double d = vv[i][j] - ((j == vv[i].size() - 1) ? 0 : vv[i][j + 1]);
        int e = min(j + 1, k);
        sum2 -= (d * e) * (k - e);
        if (j >= (k + 1) / 2) {
          e = (k + 1) / 2;
          int f = k / 2 - (n - vv[i].size());
          if (j >= vv[i].size() - f) e += j - (vv[i].size() - f) + 1;
        }
        sum2 += (d * e) * (k - e);
      }
      ans = max(ans, sum2);
    }
  }
  printf("%.8lf\n", ans);
  return 0;
}
