#include <bits/stdc++.h>
const int maxn = 5E5 + 77;
struct Point {
  int x, y;
  void read() { scanf("%d%d", &x, &y); }
  void print() { printf("(%d, %d)\n", x, y); }
  bool operator<(const Point &o) const {
    if (x == 0 && o.x == 0) return y < o.y;
    if (x == 0) return true;
    if (o.x == 0) return false;
    long long l = y * (long long)o.x, r = o.y * (long long)x;
    if (l == r) return x < o.x;
    int d = 0;
    if (x < 0) d ^= 1;
    if (o.x < 0) d ^= 1;
    if (d)
      return l < r;
    else
      return l > r;
  }
  double dis() {
    double a = x, b = y;
    return sqrt(a * a + b * b);
  }
} points[maxn];
int N, K;
std::vector<std::shared_ptr<std::vector<double>>> G;
double C[maxn];
int cc = 0;
bool sg(int i, int j) {
  assert(points[i].x != 0 && points[j].x != 0);
  if (points[i].x > 0 && points[j].x < 0) return false;
  if (points[i].x < 0 && points[j].x > 0) return false;
  long long l = points[i].y * (long long)points[j].x,
            r = points[j].y * (long long)points[i].x;
  return l == r;
}
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; ++i) points[i].read();
  std::sort(points, points + N);
  assert(points[0].x == 0);
  int i = 0;
  if (points[i].y < 0) {
    G.push_back(std::make_shared<std::vector<double>>());
    while (points[i].y < 0) {
      assert(i < N);
      (*G.rbegin())->push_back(-points[i++].y);
    }
  }
  assert(i < N && points[i].x == 0 && points[i].y == 0);
  i++;
  if (i < N && points[i].x == 0) {
    G.push_back(std::make_shared<std::vector<double>>());
    while (i < N && points[i].x == 0) {
      assert(points[i].y > 0);
      (*G.rbegin())->push_back(points[i++].y);
    }
  }
  while (i < N) {
    int l = i;
    G.push_back(std::make_shared<std::vector<double>>());
    while (i < N && sg(i, l)) (*G.rbegin())->push_back(points[i++].dis());
  }
  double all_cost = 0, all_tot = 0;
  int cnt_large = 0;
  for (auto g : G) {
    std::sort(g->begin(), g->end(), std::greater<double>());
    double tot = 0, mut = 0, last = 0;
    for (int i = 0; i < K && (long unsigned int)i < g->size(); ++i) {
      mut += tot - (*g)[i] * i;
      tot += (*g)[i];
      double cur = mut + tot * (K - i - 1);
      C[cc++] = cur - last;
      last = cur;
      if ((long unsigned)i == g->size() - 1) {
        all_cost += cur;
        all_tot += tot;
      } else if (i == K - 1) {
        ++cnt_large;
      }
    }
  }
  std::sort(C, C + cc, std::greater<double>());
  double ans = 0;
  for (int i = 0; i < K; ++i) ans += C[i];
  if (cnt_large == 0) {
    for (auto g : G)
      if (N - g->size() <= (long unsigned)K) {
        assert((long unsigned)K >= g->size());
        double tot = 0, mut = 0;
        int rem = K - (N - g->size());
        for (int i = 0; (long unsigned)i < g->size(); ++i) {
          mut += tot - (*g)[i] * i;
          tot += (*g)[i];
        }
        double cur = mut + tot * (K - g->size());
        cur = all_cost - cur;
        double totu = 0, totd = 0;
        mut = 0;
        for (int i = 0; i < rem; ++i) {
          mut += totu - (*g)[i] * i;
          totu += (*g)[i];
        }
        double t = cur + mut + totu * (N - g->size());
        if (t > ans) ans = t;
        for (int i = 0; i < rem; ++i) {
          int s = g->size() - i - 1, l = rem - i - 1;
          totu -= (*g)[l];
          mut -= totu - (*g)[l] * l;
          mut -= (*g)[l] * i - totd;
          mut += (*g)[s] * i - totd;
          mut += totu - (*g)[s] * l;
          totd += (*g)[s];
          t = cur + mut + (totu + totd) * (N - g->size());
          if (t > ans) ans = t;
        }
      }
  } else if (cnt_large == 1) {
    for (auto g : G)
      if ((g->size() > (long unsigned)K) &&
          (N - g->size() <= (long unsigned)K)) {
        int rem = K - (N - g->size());
        double cur = all_cost;
        double mut = 0;
        double totu = 0, totd = 0;
        mut = 0;
        for (int i = 0; i < rem; ++i) {
          mut += totu - (*g)[i] * i;
          totu += (*g)[i];
        }
        double t = cur + mut + totu * (N - g->size());
        if (t > ans) ans = t;
        for (int i = 0; i < rem; ++i) {
          int s = g->size() - i - 1, l = rem - i - 1;
          totu -= (*g)[l];
          mut -= totu - (*g)[l] * l;
          mut -= (*g)[l] * i - totd;
          mut += (*g)[s] * i - totd;
          mut += totu - (*g)[s] * l;
          totd += (*g)[s];
          t = cur + mut + (totu + totd) * (N - g->size());
          if (t > ans) ans = t;
        }
      }
  }
  printf("%.10lf\n", ans);
}
