#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  Point operator-(Point p) { return {x - p.x, y - p.y}; }
};
bool InUpper(Point p) { return p.y > 0 || (p.y == 0 && p.x > 0); }
long long CrossProd(Point A, Point B) {
  return 1LL * A.x * B.y - 1LL * A.y * B.x;
}
int n, k;
vector<Point> pts;
vector<vector<double>> lines;
vector<vector<double>> choose;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (x == 0 && y == 0) continue;
    ;
    pts.push_back({x, y});
  }
  n--;
  sort(pts.begin(), pts.end(), [&](Point &a, Point &b) {
    int au = InUpper(a);
    int bu = InUpper(b);
    if (au != bu) {
      return au > bu;
    }
    return CrossProd(a, b) > 0;
  });
  int r = 0;
  for (int i = 0; i < n; i = r) {
    while (r < n && InUpper(pts[i]) == InUpper(pts[r]) &&
           CrossProd(pts[i], pts[r]) == 0)
      r++;
    vector<double> line;
    choose.push_back(vector<double>());
    if (i == 0) line.push_back(0);
    for (int j = i; j < r; j++) line.push_back(hypot(pts[j].x, pts[j].y));
    sort(begin(line), end(line));
    lines.push_back(line);
  }
  vector<pair<double, pair<int, int>>> pos;
  int ov = -1;
  for (int i = 0; i < (int)(lines).size(); i++) {
    if ((int)(lines[i]).size() * 2 >= k + 1) {
      ov = i;
    }
    for (int j = (int)(lines[i]).size() - 1, c = 0; j >= 0 && 2 * c + 1 <= k;
         j--, c++) {
      pos.push_back({lines[i][j] * (k - 2 * c - 1), {i, j}});
    }
  }
  sort(pos.begin(), pos.end(), greater<pair<double, pair<int, int>>>());
  auto add = [&](pair<int, int> p) {
    int x = p.first, y = p.second;
    choose[x].push_back(lines[x][y]);
  };
  for (int i = 0; i < min(k, (int)(pos).size()); i++) add(pos[i].second);
  if (k > (int)(pos).size()) {
    assert(ov != -1);
    for (int j = 0; j < k - (int)(pos).size(); j++)
      choose[ov].push_back(lines[ov][j]);
  }
  for (int i = 0; i < (int)(choose).size(); i++)
    sort(begin(choose[i]), end(choose[i]));
  long double res = 0;
  for (vector<double> &line : choose) {
    long double sum = 0;
    for (int j = 0; j < (int)(line).size(); j++) {
      res += j * line[j] - sum;
      res += (k - (int)(line).size()) * line[j];
      sum += line[j];
    }
  }
  cout << fixed << setprecision(10) << res << '\n';
}
