#include <bits/stdc++.h>
 
using namespace std;
 
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

 
//typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;
 
#define siz(x) (int)(x).size()
#define Y second
#define X first
#define IN insert
#define PB push_back
#define P pop_back
#define PU push
#define PO pop
//#define F find
#define ED end()
#define MP( a, b) make_pair( a, b )
 
//#define MOD 1000000007ll
#define INF 1000000000
#define endl "\n"
#define rep(a,i,b) for (ll i = (a); i < (b); ++i)
#define reps(a,i,b) for (ll i = (a); i <= (b); ++i)
#define repd( num, i, ed ) for(ll (i)= (num)-1; (i) >= ed; --(i))
#define repkt( bg, i, num, kt ) for(ll (i)= (bg); (i) < (num) && (kt); ++(i))
#define repchar( i ) for(char (i)= 48; (i) <= 122; (i)++)   
// #define in(n) scanf("%lld", &n)
#define out(n) printf("%lld\n", n)
#define outS(s) printf("%s\n", s)
#define setA(a,n) for(ll i= 0, j= sizeof(a)/sizeof(a[0]); i < j; ++i) a[i]= n;
#define repe(num,i,ed) for(ll (i)= (num); (i) >= ed; --(i))
// const int INF=0x3f3f3f3f;
const db PI=acos(-1);
const ll mod=1e9+7;
const ll N=200000+5,K=105;
const int si=(1<<20);
// const ll add=1e4;
const ll M=100+5;
const double INFdb=1e10;

ld cx[65]={0},cy[65]={0},kd[65]={0};
ll n,k;
const ld EPS=1e-14;

bool check(ld num)
{
    ld cd[65];
    for(int i=0;i<n;++i) cd[i]=num/kd[i];
    vector<pair<ld,ld>> points;
    for(int i=0;i<n;++i)
    {
        for(int j=i+1;j<n;++j)
        {
            ld x1=cx[i],y11=cy[i];
            ld x2=cx[j],y2=cy[j];
            ld dist=sqrt((x1-x2)*(x1-x2)+(y11-y2)*(y11-y2));
            ld d1=cd[i],d2=cd[j];
            if(d1+d2<dist+EPS) continue;
            if(dist<max(d1-d2,d2-d1)+EPS) continue;

            ld cos=(d1*d1+dist*dist-d2*d2)/(2*d1*dist);
            ld sin1=sqrt(abs(1-cos*cos));
            ld sin2=-sin1;
            ld dx=(x2-x1)*d1/dist,dy=(y2-y11)*d1/dist;
            ld vx1=dx*cos-dy*sin1,vx2=dx*cos-dy*sin2;
            ld vy1=dx*sin1+dy*cos,vy2=dx*sin2+dy*cos;

            points.push_back(pair<ld,ld>(x1+vx1,y11+vy1));
            points.push_back(pair<ld,ld>(x1+vx2,y11+vy2));
        }
        points.push_back(pair<ld,ld>(cx[i],cy[i]));
    }
    for(int i=0;i<(int)points.size();++i)
    {
        int cnt=0;
        ld px=points[i].X,py=points[i].Y;
        for(int j=0;j<n;++j)
        {
            ld ox=cx[j],oy=cy[j],od=cd[j];
            ld dist=sqrt((ox-px)*(ox-px)+(oy-py)*(oy-py));
            if(dist<=od+EPS) ++cnt;
        }
        if(cnt>=k) return 1;
    }
    return 0;
}

int main()
{
	ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
    cin>>n>>k;
    for(int i=0;i<n;++i) 
    {
        cin>>cx[i]>>cy[i]>>kd[i];
    }
    ld low=0,high=1e6;
    for(int times=0;times<500;++times)
    {
        ld mid=(low+high)/2;
        // cout<<mid<<endl;
        if(check(mid)) high=mid;
        else low=mid;
    }
    cout<<fixed<<setprecision(10)<<high<<endl;
    cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";                                                                          
    return 0;
}

Measured memory_bytes: 384