#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }


struct point{
    double x, y;
};
struct circle{
    double x, y, r;
    bool operator == (circle b){
        return x == b.x && y == b.y;
    }
};
struct line{
    double a, b, c;
};
namespace intersect_circles {
    circle a, b;
    int straight_contact_cricle (circle o, line l, point &a, point &b) {
        point t;
        double EPS = 1e-7;
        l.c = l.a * o.x + l.b * o.y + l.c;
        t.x = -l.a * l.c / (l.a * l.a + l.b * l.b);
        t.y = -l.b * l.c / (l.a * l.a + l.b * l.b);
        if (l.c * l.c > o.r * o.r * (l.a * l.a + l.b * l.b) + EPS) {
            return 0;
        }
        else if(abs(l.c * l.c - o.r * o.r * (l.a * l.a + l.b * l.b)) < EPS) {
            a.x = t.x + o.x;
            a.y = t.y + o.y;
            return 1;
        }
        else {
            double d = o.r * o.r -l.c * l.c / (l.a * l.a + l.b * l.b);
            double mult = sqrt (d / (l.a * l.a + l.b * l.b));
            a.x = t.x + l.b * mult + o.x;
            a.y = t.y - l.a * mult + o.y;
            b.x = t.x - l.b * mult + o.x;
            b.y = t.y + l.a * mult + o.y;
            return 2;
        }
    }
    line c;
    inline vector<point> intersect (circle a, circle b) {
        c.a = 2 * b.x - 2 * a.x;
        c.b = 2 * b.y - 2 * a.y;
        c.c = sqr(a.x) + sqr(a.y) - sqr(b.x) - sqr(b.y) + sqr(b.r) - sqr(a.r);
        point ans, ans2;
        int d = straight_contact_cricle(b, c, ans, ans2);
        if (d == 0) return {};
        if (d == 1) return {ans};
        return {ans, ans2};
    }
};
main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> n >> k;
    if (n == 1) {
        cout << "0\n";
        rr;
    }
    vector <pair<pii, int> > a(n);
    for (auto &i : a) {
        cin >> i.x.x >> i.x.y >> i.y;
    }
    ld l = 0, r = 1e8;
    while (r - l > 1e-7) {
        ld mid = (l + r) / 2.0;
        vector <point> check;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                circle A{a[i].x.x, a[i].x.y, (ld)mid / a[i].y};
                circle B{a[j].x.x, a[j].x.y, (ld)mid / a[j].y};
                vector <point> vec = intersect_circles::intersect(A, B);
                for (auto &I : vec) check.pb(I);
            }
            check.pb(point{a[i].x.x, (ld)mid / a[i].y + a[i].x.y});
        }
        bool ok = false;
        for (auto &i : check) {
            int cnt = 0;
            for (auto &j : a) {
                if ((sqr(i.x - j.x.x) + sqr(i.y - j.x.y)) <= sqr(mid / j.y) + 1e-7) ++cnt;
            }
            if (cnt >= k) {
                ok = true;
                break;
            }
        }
        if (ok) r = mid;
        else l = mid + 1e-7;
    }
    cout << fixed;
    cout.precision(10);
    cout << r << '\n';
}


Measured memory_bytes: 3904