#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

using Real = double;
using Point = complex<Real>;
Real pi = acos(-1.0);

bool eq(Real a, Real b) {return abs(b-a) < EPS;}

Point operator * (const Point &p, const Real &d){
    return Point(real(p) * d, imag(p) * d);
}

Point operator / (const Point &p, const Real &d){
    return p * (1/d);
}

istream &operator >> (istream &is, Point &p){
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}

ostream &operator << (ostream &os, Point &p){
    return os << sp(10) << real(p) << ' ' << imag(p);
}

Point rotate(const Point &p, Real the){
    return p * Point(cos(the), sin(the));
}

struct Line{
    Point a, b;
    Line() = default;
    Line (Point a, Point b) : a(a), b(b) {}
};

struct Segment : Line{
    Segment() = default;
    Segment(Point a, Point b) : Line(a, b) {}
};

struct Circle{
    Point p;
    Real r;
    Circle() = default;
    Circle(Point p, Real r) : p(p), r(r) {}
};

Real dot(const Point &p, const Point &q){
    return real(p) * real(q) + imag(p) * imag(q);
}

Real det(const Point &p, const Point &q){
    return real(p) * imag(q) - imag(p) * real(q);
}

int ccw(const Point &a, Point b, Point c){
    b = b - a, c = c - a;
    if(det(b, c) > EPS) return +1; //反時計周り
    if(det(b, c) < -EPS) return -1; //時計回り
    if(dot(b, c) < -EPS) return +2; //逆方向
    if(norm(b) < norm(c)) return -2; //順方向
    return 0; //被り
}

bool parallel(const Line &a, const Line &b){
    return eq(det(a.b - a.a, b.b - b.a), 0.0);
}

bool orthogonal(const Line &a, const Line &b) {
    return eq(dot(a.b - a.a, b.b - b.a), 0.0);
}

Point projection(const Line &l, const Point &p){
    Real t = dot(p - l.a, l.b - l.a) / norm(l.b - l.a);
    return l.a + (l.b - l.a) * t;
}

Point projection(const Segment &s, const Point &p){
    Real t = dot(p - s.a, s.b - s.a) / norm(s.b - s.a);
    return s.a + (s.b - s.a) * t;
}

bool intersect(const Line &l, const Point &p){
    return abs(ccw(l.a, l.b, p)) != 1;
}

bool intersect(const Segment &s, const Point &p){
    return ccw(s.a, s.b, p) == 0;
}

bool intersect(const Line &l, const Line &m){
    if(abs(det(l.b - l.a, m.b - m.a)) > EPS) return true;
    return eq(det(l.b - l.a, m.b - l.a), 0.0);
}

bool intersect(const Line &l, const Segment &s){
    return det(l.b - l.a, s.a - l.a) * det(l.b - l.a, s.b - l.a) < EPS;
}

Real distance(const Line &l, const Point &p){
    return abs(p - Point(projection(l, p)));
}

bool intersect(const Circle &c, const Line &l){
    return distance(l, c.p) < c.r - EPS;
}

bool intersect(const Circle &c, const Point &p){
    return eq(abs(p - c.p), c.r);
}

bool intersect(const Segment &s, const Segment &t){
    if(ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) > 0) return false;
    return ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}

int intersect(Circle c1, Circle c2){ //共通接線の本数
    if(c1.r < c2.r) swap(c1, c2);
    Real d = abs(c1.p - c2.p);
    if(c1.r + c2.r < d - EPS) return 4;
    if(eq(c1.r + c2.r, d)) return 3;
    if(c1.r - c2.r < d - EPS) return 2;
    if(eq(c1.r - c2.r, d)) return 1;
    return 0; 
}

Real distance(const Point &p, const Point &q){
    return abs(q - p);
}

Real distance(const Line &l, const Line &m){
    return intersect(l, m)? 0 : distance(l, m.a); 
}

Real distance(const Segment &s, const Point &p){
    Point h = projection(s, p);
    if(intersect(s, h)) return abs(h - p);
    return min(abs(s.a - p), abs(s.b - p));
}

Real distance(const Segment &s, const Segment &t){
    if(intersect(s, t)) return 0;
    return min({distance(s, t.a), distance(s, t.b), distance(t, s.a), distance(t, s.b)});
}

Real distance(const Line &l, const Segment &s){
    if(intersect(l, s)) return 0;
    return min(distance(l, s.a), distance(l, s.b));
}

Point crosspoint(const Line &l, const Line &m){
    Real A = det(l.b - l.a, m.b - m.a);
    Real B = det(l.b - l.a, l.b - m.a);
    if(eq(A, 0.0) && eq(B, 0.0)) return m.a;
    return m.a + (m.b - m.a) * B/A;
}

Point crosspoint(const Segment &s, const Segment &t){
    return crosspoint(Line(s), Line(t));
}

vector<Point> crosspoint(const Circle &c, const Line &l){
    vector<Point> ret;
    if(!intersect(c, l)) return ret;
    Point h = projection(l, c.p);
    Point e = (l.b - l.a) / abs(l.b - l.a);
    if(eq(abs(h - c.p), c.r)) ret.eb(h);
    else{
        Real base = sqrt(c.r * c.r - norm(h - c.p));
        ret.eb(h + e * base), ret.eb(h - e * base);
    }
    return ret;
}

vector<Point> crosspoint(const Circle & c1, const Circle & c2){
    vector<Point> ret;
    if(intersect(c1, c2) % 4 == 0) return ret;
    Real d = abs(c1.p - c2.p);
    Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    Real t = atan2(c2.p.imag() - c1.p.imag(), c2.p.real() - c1.p.real());
    if(eq(a, 0.0)) ret.eb(Point(c1.p + rotate(Point(c1.r, 0.0), t)));
    else{
        Point p1 = c1.p + rotate(Point(c1.r, 0.0), t+a);
        Point p2 = c1.p + rotate(Point(c1.r, 0.0), t-a);
        ret.eb(p1), ret.eb(p2);
    }
    return ret;
}

Line vertical_bisector(const Point &p, const Point &q){
    Line l;
    l.a = (p + q) / 2.0;
    l.b = l.a + rotate(q - p, pi/2);
    return l;
}

Circle Apollonius(const Point &p, const Point &q, Real a, Real b){
    Point p1 = (p*b + q*a) / (a+b), p2 = (-p*b + q*a) / (a-b);
    Circle c;
    c.p = (p1 + p2) / 2.0;
    c.r = abs(p1 - p2) / 2.0;
    return c;
}

bool comp_x(const Point &p, const Point &q){
    if(!eq(real(p), real(q))) return real(p) < real(q);
    return imag(p) < imag(q);
}

vector<Point> convex_hull(vector<Point> &p){
    int n = sz(p), k = 0;
    sort(all(p), comp_x);
    vector<Point> ch(2*n);
    for(int i = 0; i < n; ch[k++] = p[i++]){
        while(k >= 2 && det(ch[k-1] - ch[k-2], p[i] - ch[k-1]) < EPS) k--;
    }
    for(int i = n-2, t = k+1; i >= 0; ch[k++] = p[i--]){
        while(k >= t && det(ch[k-1] - ch[k-2], p[i] - ch[k-1]) < EPS) k--; 
    }
    ch.resize(k-1);
    return ch;
}

int main(){
    int N, K;
    cin >> N >> K;
    Point p[N];
    Real c[N];
    rep(i, N) cin >> p[i] >> c[i];
    Real t[N], ans = 1e10;
    Point center;
    rep(i, N){
        center = p[i];
        rep(j, N){
            t[j] = c[j]*abs(p[j]-center);
        }
        sort(t, t+N);
        chmin(ans, t[K-1]);
    }
    rep(i, N){
        rep2(j, i+1, N-1){
            center = (p[i]*c[i]+p[j]*c[j]) / (c[i]+c[j]);
            rep(k, N){
                t[k] = c[k]*abs(p[k]-center);
            }
            sort(t, t+N);
            chmin(ans, t[K-1]);
        }
    }
    rep(i, N){
        rep2(j, i+1, N-1){
            rep2(k, j+1, N-1){
                if(parallel(Line(p[i], p[k]), Line(p[j], p[k]))) continue;
                vector<Point> check;
                if(c[i] == c[k] && c[j] == c[k]){
                    Line l1 = vertical_bisector(p[i], p[k]), l2 = vertical_bisector(p[j], p[k]);
                    check.eb(crosspoint(l1, l2));
                }
                elif(c[i] == c[k]){
                    Line l1 = vertical_bisector(p[i], p[k]);
                    Circle c1 = Apollonius(p[j], p[k], c[k], c[j]);
                    check = crosspoint(c1, l1);
                }
                elif(c[j] == c[k]){
                    Line l1 = vertical_bisector(p[j], p[k]);
                    Circle c1 = Apollonius(p[i], p[k], c[k], c[i]);
                    check = crosspoint(c1, l1);
                }
                else{
                    Circle c1 = Apollonius(p[i], p[k], c[k], c[i]);
                    Circle c2 = Apollonius(p[j], p[k], c[k], c[j]);
                    check = crosspoint(c1, c2);
                }
                for(auto &e: check){
                    rep(l, N){
                        t[l] = c[l]*abs(p[l]-e);
                    }
                    sort(t, t+N);
                    chmin(ans, t[K-1]);
                }
            }
        }
    }
    cout << sp(10) << ans << endl;
}

Measured memory_bytes: 4504