unittest
{
	assert( [ "4 3", "-1 0 3", "0 0 3", "1 0 2", "1 1 40" ].solve == "2.400000" );
	assert( [ "10 5", "-879 981 26", "890 -406 81", "512 859 97", "362 -955 25", "128 553 17", "-885 763 2", "449 310 57", "-656 -204 11", "-270 76 40", "184 170 16" ].solve == "7411.225279" );
}



import std.algorithm;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = 0L;
	auto k = 0L;
	input.front.formattedRead!"%s %s"( n, k );
	auto xycs = new long[ 3 ][ n ];
	foreach( ref xyc; xycs )
	{
		input.popFront;
		xyc = input.front.split.to!( long[] );
	}
	
	// xとyの二重三分探索
	auto ans = real.max;
	auto f( real x, real y )
	{
		auto ts = new real[ xycs.length ];
		foreach( ref t, xyc; lockstep( ts, xycs ) )
		{
			t = xyc[ 2 ] * hypot( x - xyc[ 0 ], y - xyc[ 1 ] );
		}
		ts.sort;
		ans = min( ans, ts[ k - 1 ] );
		return ts[ k - 1 ];
	}
	trisect!( ( x ) => f( x, trisect!( ( y ) => f( x, y ) )( -1000, 1000 ) ) )( -1000, 1000 );
	return format( "%0.6f", ans );
}

// 凸or凹関数の三分探索
auto trisect( alias pred, bool convex = true )( real l, real r )
if( is( typeof( pred( l ) ) : real ) )
{
	const G = ( 1.0L + 5.0L ^^ 0.5 ) / 2;		// 黄金比
	auto lx = ( l * G + r ) / ( 1 + G );
	auto ly = pred( lx );
	auto rx = ( l + r * G ) / ( 1 + G );
	auto ry = pred( rx );
	foreach( i; 0 .. 100 )
	{
		if( ( convex && ly < ry ) || ( !convex && ry < ly ) )
		{
			r = rx;
			rx = lx;
			ry = ly;
			lx = ( l * G + r ) / ( 1 + G );
			ly = pred( lx );
		}
		else
		{
			l = lx;
			lx = rx;
			ly = ry;
			rx = ( l + r * G ) / ( 1 + G );
			ry = pred( rx );
		}
	}
	return ( l + r ) / 2;
}
