#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;
const double EPS = 1e-8, INF = 1e12, PI = acos(-1.0);
typedef complex<double> P;
namespace std{
	bool operator<(const P& a, const P& b){
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}
inline double cross(const P& a, const P& b){ return imag(conj(a)*b); }
inline double dot(const P& a, const P& b){ return real(conj(a)*b); }
struct L : public vector<P>{
	L(const P &a, const P &b) {
		push_back(a); push_back(b);
	}
};
typedef vector<P> G;
inline int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if(cross(b, c) >  EPS)   return +1;      // counter clockwise
	if(cross(b, c) < -EPS)   return -1;      // clockwise
	if(dot(b, c)   < -EPS)   return +2;      // c--a--b on line
	if(norm(b)+EPS <norm(c)) return -2;      // a--b--c on line
	return 0;                                   // c is between a and b (inclusive)
}
G isCL(const P &c, double r, const P &p1, const P &p2){
	double x = dot(p1 - c, p2 - p1);
	double y = norm(p2 - p1);
	double d = x * x - y * (norm(p1 - c) - r * r);
	if(d < -EPS) return G(0);
	if(d < 0) d = 0;
	P q1 = p1 - (p2 - p1) * (x / y);
	P q2 = (p2 - p1) * (sqrt(d) / y);
	G res; res.pb(q1 - q2); res.pb(q1 + q2);
	return res;
}
G isCC(const P &c1, double r1, const P &c2, double r2){
	double x = norm(c1 - c2);
	double y = ((r1 * r1 - r2 * r2) / x + 1) / 2;
	double d = r1 * r1 / x - y * y;
	if(d < -EPS) return vector<P>(0);
	if(d < 0) d = 0;
	P q1 = c1 + (c2 - c1) * y, q2 = (c2 - c1) * sqrt(d) * P(0, 1);
	G res;
	res.pb(q1 - q2); res.pb(q1 + q2);
	return res;
}
typedef pair<pair<P, double>, pair<P, P>> E;
P NG(INF, INF);

E eqp(const pair<P, double> &a, const pair<P, double> &b){
	double t = (double)a.second / (a.second + b.second);
	P inner = a.first * t + b.first * (1 - t);
	
	if(a.second == b.second){
		P d = inner + (b.first - a.first) * P(0, 1);
		return E(make_pair(NG, 0), make_pair(inner, d));
	}
	
	double s = (double)a.second / (a.second - b.second);
	P outer = a.first * s + b.first * (1 - s);
	
	return E(make_pair((inner + outer) / 2.0, abs(inner - outer) / 2), make_pair(NG, NG));
}
G crosspoint(const L &l, const L &m) {
	double A = cross(l[1] - l[0], m[1] - m[0]);
	double B = cross(l[1] - l[0], l[1] - m[0]);
	if (abs(A) < EPS && abs(B) < EPS) return {m[0]}; // same line
	if (abs(A) < EPS) return {};
	return {m[0] + B / A * (m[1] - m[0])};
}
G cp(const E &a, const E &b){
	if(a.first.first == NG){
		if(b.first.first == NG) return crosspoint(
			L(a.second.first, a.second.second), L(b.second.first, b.second.second));
		return isCL(b.first.first, b.first.second, a.second.first, a.second.second);
	}
	if(b.first.first == NG) return isCL(a.first.first, a.first.second, b.second.first, b.second.second);
	return isCC(a.first.first, a.first.second, b.first.first, b.first.second);
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n, k; cin >> n >> k;
	vector<pair<P, double>> in;
	rep(i, n){
		int x, y, c; cin >> x >> y >> c;
		in.emplace_back(P(x, y), c);
	}
	
	auto calc = [&](const P &o){
		vector<double> t;
		rep(i, n) t.pb(in[i].second * abs(o - in[i].first));
		sort(all(t));
		return t[k - 1];
	};
	
	double ans = INF;
	rep(i, n) ans = min(ans, calc(in[i].first));
	rep(i, n) rep(j, i){
		double t = (double)in[i].second / (in[i].second + in[j].second);
		ans = min(ans, calc(in[i].first * t + in[j].first * (1 - t)));
	}
	rep(i, n) rep(j, i) rep(k, j){
		E a = eqp(in[i], in[j]), b = eqp(in[j], in[k]), c = eqp(in[k], in[i]);
		G A = cp(a, b), B = cp(b, c), C = cp(c, a), g;
		g.insert(g.end(), all(A));
		g.insert(g.end(), all(B));
		g.insert(g.end(), all(C));
		for(P p : g) ans = min(ans, calc(p));
	}
	
	printf("%.20f\n", ans);
	
	return 0;
}

Measured memory_bytes: 384