import Control.Monad
data Point = Point Double Double deriving (Show, Eq)
data Circle = Circle Point Double deriving (Show, Eq)

limite = 1e-7

cuad :: Double->Double
cuad x = x * x

locrot :: Point->Double->Point
locrot (Point x y) ang = Point (x * can - y * san) (x * san + y * can)
 where (san, can) = (sin ang, cos ang)

rotate :: Double->Point->Point->Double->Point
rotate cnst (Point x1 y1) (Point x2 y2) ang = Point (x1 + x3) (y1 + y3)
 where 
  vc = Point (x2 - x1) (y2 - y1) 
  Point x3 y3 = (multip cnst) $ locrot vc ang

multip :: Double->Point->Point
multip w (Point x y) = Point (x * w) (y * w)

semidis :: Point->Point->Double
semidis (Point x1 y1) (Point x2 y2) = (cuad $ x1 - x2) + (cuad $ y1 - y2)

distance :: Point->Point->Double
distance a b = sqrt $ semidis a b 

isTriang :: [Double]->Bool
isTriang lst = 2 * (maximum lst) <= (sum lst)

getangle :: [Double]->Double
getangle [a, b, c] = acos mined
 where
  tmp = ((cuad a) + (cuad b) - (cuad c)) / a / b / 2
  maxed = max tmp (-1)
  mined = min tmp 1

intersec :: Circle->Circle->[Point]
intersec (Circle p1 r1) (Circle p2 r2) = if isTriang lst then [fn ang, fn $ -ang] else [] 
 where 
  ang = getangle lst
  lst = [dis, r1, r2]
  dis = distance p1 p2
  fn = rotate (r1 / dis) p1 p2

incirc :: Point->Circle->Bool
incirc pt (Circle cn rd) = ((cuad $ rd + limite) >=) $ semidis pt cn

allin :: [Circle]->Point->Int
allin ls pt = (foldl (+) 0) $ map (\x->if incirc pt x then 1 else 0) ls

possible :: Int->[Circle]->Bool
possible k lst = foldl (||) False semi
 where 
  norm = map (\(Circle cn _)-> cn) lst
  cnds = foldl (++) [] [intersec a b | a<-lst, b<-lst, a /= b]
  semi = map ((k <= ) . allin lst) $ norm++cnds

transf :: Double->(Point, Double)->Circle
transf lm (pt, wg) = Circle pt (lm / wg)

valid :: Int->[(Point, Double)]->Double->Bool
valid k lst lmt = possible k crcls
 where crcls = map (transf lmt) lst

bins :: Int->Int->Double->Double->[(Point, Double)]->Double
bins _ 0 le _ _ = le
bins k offs le ri lst = bins k (offs-1) lf rg lst
 where 
  mi = (le + ri) / 2
  (lf, rg) = if valid k lst mi then (le, mi) else (mi, ri)

rdb :: String->Double
rdb = read

rdln :: String->(Point, Double)
rdln ln = (Point a b, c)
 where [a, b, c] = (map rdb) $ words ln

rpt :: Int->(Double->Double)->Double
rpt 0 _ = 1
rpt x fn = (fn 1) + (rpt (x - 1) fn)

main=do
 nk_str<-getLine
 let [n, k] = (map (\x->read x :: Int)) $ words nk_str
 lsta <- (replicateM n getLine)
 let gdl = map rdln lsta
 print $ bins k 35 0 4e5 gdl
 --let lst = map (transf 2.4) gdl
 --print $ foldl (++) [] [intersec a b | a<-lst, b<-lst, a /= b]
 
