#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
template <class T>
inline T fast(T a, T b, T mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
template <class T>
istream &operator>>(istream &is, pair<T, T> &p) {
  is >> p.first >> p.second;
  return is;
}
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return abs(a);
}
const long long INF = 1e9 + 7;
const long long mod = 998244353;
const long long BIG_INF = 1e18 + 7;
const long long N = 1e6 + 7;
const long long T = 1 << 20;
const long double inf = 1e18;
long long m, n, k, q;
map<pair<int, int>, vector<pair<long double, int>>> mapa;
vector<vector<pair<int, long double>>> G(N), G2(N);
long double dist[N];
int roz[N];
int roz2[N];
long double case1 = 0;
long double case2 = 0;
vector<int> odw;
void dfs(int x, int pre = 0) {
  roz[x] = 1;
  for (auto &u : G[x]) {
    if (u.first != pre) {
      dfs(u.first, x);
      roz[x] += roz[u.first];
    }
  }
}
void dfs3(int x, int pre = 0) {
  roz2[x] = 1;
  for (auto &u : G2[x])
    if (u.first != pre) {
      dfs3(u.first, x);
      roz2[x] += roz2[u.first];
    }
  assert(roz2[x] <= k);
}
void dfs2(int x) {
  odw[x] = 1;
  for (auto &u : G[x])
    if (!odw[u.first]) {
      G2[x].push_back({u.first, abs(dist[u.first] - dist[x])});
      G2[u.first].push_back({x, abs(dist[u.first] - dist[x])});
      dfs2(u.first);
    }
}
void Policz_G2(int x, int pre = -1) {
  for (auto &u : G2[x])
    if (u.first != pre) {
      case1 += u.second * roz2[u.first] * (k - roz2[u.first]);
      Policz_G2(u.first, x);
    }
}
int nast(int teraz, int przed) {
  for (auto &u : G[teraz])
    if (u.first != przed) return u.first;
  assert(false);
}
void solve() {
  cin >> n >> k;
  vector<pair<int, int>> input(n);
  odw = vector<int>(n);
  cin >> input;
  sort((input).begin(), (input).end(), [](pair<int, int> a, pair<int, int> b) {
    return abs(a.first) + abs(a.second) < abs(b.first) + abs(b.second);
  });
  for (int i = 0; i < n; i++) {
    long long a = input[i].first, b = input[i].second;
    cin >> a >> b;
    dist[i] = sqrt(a * a + b * b);
    if (a or b) {
      long long GCD = gcd(a, b);
      mapa[{a / GCD, b / GCD}].push_back({dist[i], i});
    }
  }
  for (auto &u : mapa) {
    sort((u.second).begin(), (u.second).end());
    G[0].push_back({u.second[0].second, u.second[0].first});
    G[u.second[0].second].push_back({0, u.second[0].first});
    for (int i = 1; i < (int)(u.second).size(); i++) {
      G[u.second[i].second].push_back(
          {u.second[i - 1].second, u.second[i].first - u.second[i - 1].first});
      G[u.second[i - 1].second].push_back(
          {u.second[i].second, u.second[i].first - u.second[i - 1].first});
    }
  }
  dfs(0);
  bool odpalil_sie = 0;
  int galaz = 0;
  for (auto &u : G[0]) {
    galaz = max(galaz, roz[u.first]);
    if (roz[u.first] >= k / 2 and (n - roz[u.first]) <= (k + 1) / 2) {
      int skok = k - (n - roz[u.first]) - k / 2;
      int temp = u.first;
      int przed = 0;
      int pocz = 0;
      while (skok--) {
        if (skok == 0) pocz = temp;
        int pom = nast(temp, przed);
        przed = temp;
        temp = pom;
      }
      long long pomin = n - k;
      while (pomin--) {
        int pom = nast(temp, przed);
        odw[temp] = 1;
        przed = temp;
        temp = pom;
      }
      int kon = temp;
      odw[pocz] = odw[kon] = 1;
      G2[pocz].push_back({kon, dist[kon] - dist[pocz]});
      G2[kon].push_back({pocz, dist[kon] - dist[pocz]});
      dfs2(pocz);
      dfs2(kon);
      dfs3(0);
      case1 = 0;
      Policz_G2(0);
      odpalil_sie = 1;
    }
  }
  vector<long double> siema;
  siema.push_back(0.0);
  for (int i = 1; i < n; i++) {
    siema.push_back(dist[i] * (k + 1 - roz[i] * 2));
  }
  sort((siema).begin(), (siema).end(), greater<long double>());
  for (int i = 0; i < k; i++) case2 += siema[i];
  if (!(case2 >= 0.0) and case1 == 0.0) cout << galaz << endl;
  cout << setprecision(10) << fixed << max(case1, case2) << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  q = 1;
  for (int i = 0; i < (q); i++) {
    solve();
  }
}
