#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n, k;
map<pair<int, int>, int> Id;
vector<long double> d[1000010];
pair<int, int> getdir(int x, int y) {
  int xx = abs(x);
  int yy = abs(y);
  int g = gcd(xx, yy);
  xx /= g;
  yy /= g;
  if (x < 0) xx = -xx;
  if (y < 0) yy = -yy;
  return make_pair(xx, yy);
}
long double val[1000010];
int N;
int getid(int x, int y) {
  pair<int, int> pr = getdir(x, y);
  if (!Id.count(pr)) Id[pr] = ++N;
  return Id[pr];
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    if (x != 0 || y != 0) {
      int id = getid(x, y);
      long double xx = x;
      long double yy = y;
      d[id].push_back(sqrt(xx * xx + yy * yy));
    }
  }
  int num = 0;
  for (int x = 1; x <= N; x++) {
    sort(d[x].begin(), d[x].end());
    int l = 0, r = (int)d[x].size() - 1;
    long double sum = 0;
    for (int i = 1; i <= k && l <= r; i++) {
      if (k - 2 * i + 1 >= 0)
        val[++num] = (k - 2 * i + 1) * d[x][r--];
      else {
        long double v = d[x][l++];
        sum += v;
        val[++num] = -2 * sum;
        if ((k - 2 * i + 1) & 1) val[num] += v;
      }
    }
  }
  val[++num] = 0;
  sort(val + 1, val + num + 1);
  reverse(val + 1, val + num + 1);
  long double ans = 0;
  for (int i = 1; i <= k; i++) ans += val[i];
  if (num < k) {
    printf("WA\n");
    while (1)
      ;
  }
  printf("%.10lf\n", (double)ans);
  return 0;
}
