#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
inline bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
inline bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

// https://prefield.com/algorithm/geometry

// point
using P = complex<ld>;

// two points: line
using L = array<P, 2>;

// points
using VP = vector<P>;

// circle
struct C {
  P c;
  ld r;
  C(const P &c_, ld r_) : c(c_), r(r_) {}
  C(ld x_, ld y_, ld r_) : c({x_, y_}), r(r_) {}
};

using VC = vector<C>;

// input
void Pin(P &a) {
  ld tmp;
  cin >> tmp;
  a.real(tmp);
  cin >> tmp;
  a.imag(tmp);
}

// output
void Pout(const P &a) {
  cout << a.real() << " " << a.imag();
}

namespace std {
  /*
  bool operator<(const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
  /*/
  bool operator<(const P &a, const P &b) {
    return arg(a) < arg(b);
  }
  //*/
} // namespace std

ld cross(const P &a, const P &b) {
  return imag(conj(a) * b);
}

ld dot(const P &a, const P &b) {
  return real(conj(a) * b);
}

// a->b->cの進行方向
int ccw(P a, P b, P c) {
  b -= a;
  c -= a;
  if (cross(b, c) > 0)   return  1; // counterclockwise a--b\\c
  if (cross(b, c) < 0)   return -1; // clockwise        a--b//c
  if (dot(b, c) < 0)     return  2; // c--a--b on line
  if (norm(b) < norm(c)) return -2; // a--b--c on line
  return 0;                         // a--c--b on line
}

// 直線-直線交差判定
bool intersectLL(const L& l, const L& m) {
  return abs(cross(l[1] - l[0], m[1] - m[0])) > EPS // non-parallel
  || abs(cross(l[1] - l[0], m[1] - l[0])) < EPS;    // same line
}

// 直線-線分交差判定
bool intersectLS(const L& l, const L& s) {
  return cross(l[1] - l[0], s[0] - l[0]) * // s[0] is left of l
  cross(l[1] - l[0], s[1] - l[0]) < EPS;   // s[1] is right of l
}

// 線分-線分交差判定
bool intersectSS(const L& s, const L& t) {
  return ccw(s[0], s[1], t[0]) * ccw(s[0], s[1], t[1]) <= 0
  && ccw(t[0], t[1], s[0]) * ccw(t[0], t[1], s[1]) <= 0;
}

// 点∈直線の判定
bool intersectLP(const L& l, const P& p) {
  return abs(cross(l[1] - p, l[0] - p)) < EPS;
}

// 点∈線分の判定
bool intersectSP(const L& s, const P& p) {
  // triangle inequality
  return abs(s[0] - p) + abs(s[1] - p) - abs(s[1] - s[0]) < EPS;
}

// 点の直線への射影
P projection(const L& l, const P& p) {
  ld t = dot(p - l[0], l[1] - l[0]) / norm(l[1] - l[0]);
  return l[0] + t * (l[1] - l[0]);
}

// 点の直線に対する鏡映
P reflection(const L& l, const P& p) {
  return p + (projection(l, p) - p) * 2.L;
}

// 点-直線の距離
ld distanceLP(const L &l, const P &p) {
  return abs(p - projection(l, p));
}

// 直線-直線の距離 非平行か同一なら0
ld distanceLP(const L &l, const L &m) {
  return intersectLL(l, m) ? 0 : distanceLP(l, m[0]);
}

// 直線-線分の距離
ld distanceLS(const L& l, const L& s) {
  return intersectLS(l, s) ? 0 : min(distanceLP(l, s[0]), distanceLP(l, s[1]));
}

// 点-線分の距離
ld distanceSP(const L& s, const P& p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}

// 線分-線分の距離
ld distanceSS(const L& s, const L& t) {
  if (intersectSS(s, t)) return 0;
  return min({distanceSP(s, t[0]),
              distanceSP(s, t[1]),
              distanceSP(t, s[0]),
              distanceSP(t, s[1])});
}

// 2直線の交点 平行な場合は例外
P crosspoint(const L &l, const L &m) {
  ld A = cross(l[1] - l[0], m[1] - m[0]);
  ld B = cross(l[1] - l[0], l[1] - m[0]);
  assert(abs(A) >= EPS);
  return m[0] + B / A * (m[1] - m[0]);
}

// 2円の交点 一致する場合は例外
VP crosspoint(C a, C b) {
  ld dist = abs(a.c - b.c);
  ld rdist = abs(a.r - b.r);
  assert(dist >= EPS || rdist >= EPS);
  // 外接する
  if(abs(dist - (a.r + b.r)) < EPS){
    return {(b.r*a.c + a.r*b.c) / (a.r + b.r)};
  }
  // 内接する
  if(abs(dist - rdist) < EPS){
    return {(-b.r*a.c + a.r*b.c) / (a.r - b.r)};
  }
  // 離れている、内包する
  if(dist > a.r + b.r || dist < rdist){
    return {};
  }
  // 交わる 中心を0と1に規格化
  // 最後に足す
  P movp = a.c;
  a.c = {0.L, 0.L};
  b.c -= movp;
  // 最後に掛ける
  P movm = b.c;
  b.c = {1.L, 0.L};
  a.r /= abs(movm);
  b.r /= abs(movm);
  ld x = (a.r*a.r - b.r*b.r + 1)/2;
  ld y = sqrt(a.r*a.r - x*x);
  P cr1 = {x, y};
  P cr2 = {x, -y};
  cr1 = cr1 * movm + movp;
  cr2 = cr2 * movm + movp;
  // 元に戻す
  return {cr1, cr2};
}

// 円盤の最大の重なり O(n^3)
ll maxOverlap(const VC &vc){
  ll n = vc.size();
  if(!n) return 0;
  ll ret = 1;
  VP pts;
  for(auto&& e: vc){
    pts.emplace_back(e.c);
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < i; j++){
      VP cp = crosspoint(vc[i], vc[j]);
      pts.insert(pts.end(), cp.begin(), cp.end());
    }
  }
  for(auto&& e: pts){
    ll tmp = 0;
    for(auto&& ee: vc){
      tmp += (abs(e - ee.c) < ee.r + EPS);
    }
    if(ret < tmp) ret = tmp;
  }
  return ret;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll n, k;
  cin >> n >> k;
  vld x(n), y(n), c(n);
  rep(i, n){
    cin >> x[i] >> y[i] >> c[i];
  }
  
  auto cond = [&](ld mid) -> bool{
    VC vc;
    rep(i, n) vc.emplace_back(x[i], y[i], mid/c[i]);
    return maxOverlap(vc) < k;
  };
  auto BS = [&](ld true_max, ld false_min){
    rep(i, 50){
      ld mid = true_max + ((false_min - true_max) / 2);
      (cond(mid) ? true_max : false_min) = mid;
    }
    return true_max;
  };
  print(BS(0, 2000*100));
  
}


Measured memory_bytes: 508