#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;

namespace Math {
    ll modpow(ll b, ll p, ll m) {
        ll r = 1;
        for (; p; p >>= 1, b = b * b % m)
            if (p & 1)
                r = r * b % m;
        return r;
    }

    ll modinv(ll b, ll m) { return modpow(b, m - 2, m); }

    // Least significant bit.
    ll lsb(ll x) { return x & (-x); }

    template <class T> const T inf() { return 0; }
    template <> const ll inf<ll>() { return 0x3f3f3f3f3f3f3f3fll; }
    template <> const int inf<int>() { return 0x3f3f3f3f; }

    template <class T> T gcd(T a, T b) { return abs(__gcd(a, b)); }
    template <class T> T clamp(T n, T l, T r) { return n < l ? l : n > r ? r : n; }
    template <class T> T lcm(T a, T b) { return abs(a / gcd(a, b) * b); }
    template <class T> T sgn(T n) { return n == 0 ? 0 : n > 0 ? 1 : -1; }

    // Generic modular integer.
    template<int MOD, typename IntType = int>
    struct GModint {
        IntType val;

        GModint() : val(0) {}

        GModint(int v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        GModint(ll v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        explicit operator bool() const { return val != 0; }

        const bool operator==(const GModint &g) const { return val == g.val; }

        const bool operator!=(const GModint &g) const { return val != g.val; }

        const GModint operator+=(const GModint &g) { return *this = *this + g; }

        const GModint operator-=(const GModint &g) { return *this = *this - g; }

        const GModint operator*=(const GModint &g) { return *this = *this * g; }

        const GModint operator/=(const GModint &g) { return *this = *this / g; }

        const GModint operator^=(const GModint &g) { return *this = *this ^ g; }

        const GModint operator-() const { return GModint(val == 0 ? 0 : MOD - val, true); }

        const GModint operator+(const GModint &g) const {
            ll newval = val + g.val;
            if (newval >= MOD)
                newval -= MOD;
            return GModint(newval, true);
        }

        const GModint operator-(const GModint &g) const { return *this + (-g); }

        const GModint operator*(const GModint &g) const { return GModint(1ll * val * g.val); }

        const GModint operator/(const GModint &g) const { return *this * g.inv(); }

        template<class T>
        const GModint operator^(const T t) const { return GModint(modpow(val, t, MOD)); }

        const GModint inv() const { return GModint(modinv(val, MOD)); }
    };

    using Modint = GModint<1000000007>;
}

int n, k;
double x[105], y[105], c[105];

double grilltime(double x0, double y0) {
    vector<double> v(n);
    for (int i = 0; i < n; i++) {
        v[i] = c[i] * sqrt((x0 - x[i]) * (x0 - x[i]) + (y0 - y[i]) * (y0 - y[i]));
    }
    sort(v.begin(), v.end());
    return v[k - 1];
}

double dir[8][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}};

typedef set<pair<double, pair<double, double>>> res;

res brute(res v, double rn, double step) {
    res nn;
    res::iterator it = v.begin();
    for (int i = 0; i < 150; i++) {
        for (double j = -rn; j <= rn; j += step) for (double k = -rn; k <= rn; k += step) {
            double nx = it->second.first + j, ny = it->second.second + k;
            nn.insert({grilltime(nx, ny), {nx, ny}});
        }
        ++it;
    }
    return nn;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i] >> c[i];
    }

    set<pair<double, pair<double, double>>> v, v2, v3;

    for (int i = -2000; i <= 2000; i += 10) for (int j = -2000; j <= 2000; j += 10) {
        v.insert({grilltime(i, j), {i, j}});
    }

    for (double rn = 5, step = 0.5; rn >= 5e-15; rn /= 10, step /= 10) {
        v = brute(v, rn, step);

//        res::iterator it = v.begin();
//        for (int i = 0; i <= 10; i++) {
//            cout << fixed << setprecision(9);
//            cout << it->second.first << " " << it->second.second << " " << it->first << endl;
//            ++it;
//        }
//        cout << "====" << endl;
    }

    cout << fixed << setprecision(20) << v.begin()->first << endl;
}


Measured memory_bytes: 26300