import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { x.modm(y.modpow(mod - 2)); }

void main()
{
	auto N = RD;
	auto K = RD;
	auto xyc = new long[][](N);
	foreach (i; 0..N)
	{
		xyc[i] = [RD, RD, RD];
	}

	double ans = double.max;
	foreach (i; 0..N)
	{
		foreach (j; i+1..N)
		{
			foreach (k; j+1..N)
			{
				auto x1 = xyc[i][0];
				auto y1 = xyc[i][1];
				auto c1 = xyc[i][2];
				auto x2 = xyc[j][0];
				auto y2 = xyc[j][1];
				auto c2 = xyc[j][2];
				auto x3 = xyc[k][0];
				auto y3 = xyc[k][1];
				auto c3 = xyc[k][2];
				double[2] vec = [x2-x1, y2-y1];
				double[2] vec2 = [x3-x2, y3-y2];
				double[2] vec3 = [x1-x3, y1-y3];
				auto ratio = cast(double)c2 / (c1+c2);
				auto ratio2 = cast(double)c3 / (c2+c3);
				auto ratio3 = cast(double)c1 / (c1+c3);
				double x0 = x1 + vec[0]*ratio + vec2[0]*ratio2 + vec3[0]*ratio3;
				double y0 = y1 + vec[1]*ratio + vec2[1]*ratio2 + vec3[1]*ratio3;

				auto list = new double[](N);
				foreach (z; 0..N)
				{
					auto xx = xyc[z][0];
					auto yy = xyc[z][1];
					auto cc = xyc[z][2];
					list[z] = sqrt((xx-x0)^^2 + (yy-y0)^^2) * cc;
				}
				list.sort();
				ans.chmin(list[K-1]);
			}
		}
	}

	writefln(FMT_F, ans);
	stdout.flush;
	debug readln;
}