{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE BangPatterns, CPP, FlexibleContexts, FlexibleInstances, GADTs  #-}
{-# LANGUAGE KindSignatures, LambdaCase, MagicHash, MultiParamTypeClasses   #-}
{-# LANGUAGE MultiWayIf, OverloadedStrings, RecordWildCards                 #-}
{-# LANGUAGE ScopedTypeVariables, TupleSections, TypeFamilies, ViewPatterns #-}

import           Control.Applicative
import           Control.Exception
import           Control.Monad
import           Control.Monad.Primitive
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Data.Bool
import qualified Data.ByteString             as B
import qualified Data.ByteString.Builder     as B
import qualified Data.ByteString.Char8       as C
import qualified Data.ByteString.Internal    as B
import qualified Data.ByteString.Unsafe      as B
import           Data.Char
import qualified Data.Foldable               as F
import           Data.Function
import           Data.Functor.Identity
import qualified Data.IntMap.Strict          as IM
import qualified Data.IntSet                 as IS
import qualified Data.List                   as L
import qualified Data.Map.Strict             as M
import           Data.Monoid
import           Data.Ord
import           Data.Primitive.MutVar
import           Data.Ratio
import qualified Data.Set                    as S
import           Data.Tuple
import qualified Data.Vector                 as V
import qualified Data.Vector.Generic         as G
import qualified Data.Vector.Generic.Mutable as GM
import qualified Data.Vector.Mutable         as VM
import qualified Data.Vector.Unboxed         as U
import qualified Data.Vector.Unboxed.Mutable as UM
import           Debug.Trace
import           Foreign                     hiding (void)
import           GHC.Exts
import qualified System.IO                   as IO
import           Unsafe.Coerce

main :: IO ()
main = do
    [n, k] <- map read.words <$> getLine :: IO [Int]
    xycs <- U.unfoldrN n (runParser $ (,,) <$> double <*> double <*> double) <$> C.getContents
    print $ solve n k xycs

double :: Parser Double
double = fromIntegral <$> int


solve :: Int -> Int -> U.Vector (Double, Double, Double) -> Double
solve n k (U.toList -> xycs) = lowerBoundDouble 0.0 1e6 $ \t ->
    let cs = [C x y (t/c) | (x, y, c) <- xycs]
        cands = do
            c0 <- cs
            c1 <- cs
            intersect c0 c1
    in any ((>= k) . flip score cs) cands

score :: Vec2 Double -> [Circle] -> Int
score p cs = length $ filter (inCircle p) cs

data Circle = C !Double !Double !Double
    deriving (Eq, Ord, Show)

center :: Circle -> Vec2 Double
center (C x y _) = V2 x y

radius :: Circle -> Double
radius (C _ _ r) = r

inCircle :: Vec2 Double -> Circle -> Bool
inCircle (V2 x0 y0) (C x y r) = dx * dx + dy * dy <= (r + eps) * (r + eps)
  where
    !dx = x - x0
    !dy = y - y0

eps :: Double
eps = 1e-8

intersect :: Circle -> Circle -> [Vec2 Double]
intersect (C x0 y0 r0) (C x1 y1 r1)
    | r0 + r1 < d - eps = []
    | r0 + r1 < d + eps = [recip (r0 + r1) *: (r1 *: V2 x0 y0 + r0 *: V2 x1 y1)]
    | d < abs (r1 - r0) + eps = if r0 < r1 then [V2 x0 y0] else [V2 x1 y1]
    | otherwise  =
        [ (2.0 * sqrt (s * (s - r0) * (s - r1) * (s - d)) / (d * d)) *: V2 (-dy) dx + c
        , (2.0 * sqrt (s * (s - r0) * (s - r1) * (s - d)) / (d * d)) *: V2 dy (-dx) + c
        ]
  where
    !dx = x1 - x0
    !dy = y1 - y0
    !d = sqrt (dx * dx + dy * dy)
    !s = 0.5 * (r0 + r1 + d)
    !k = (d * d + r0 * r0 - r1 * r1) / (2.0 * d)
    c = recip d *: ((d - k) *: V2 x0 y0 + k *: V2 x1 y1)


data Vec2 a = V2 !a !a deriving (Eq, Ord)

instance Show a => Show (Vec2 a) where
    show (V2 x y) = show [x, y]

instance Functor Vec2 where
    fmap f (V2 x y) = V2 (f x) (f y)

instance (Num a) => Num (Vec2 a) where
    (V2 x0 y0) + (V2 x1 y1) = V2 (x0 + x1) (y0 + y1)
    (V2 x0 y0) - (V2 x1 y1) = V2 (x0 - x1) (y0 - y1)
    (V2 x0 y0) * (V2 x1 y1) = V2 (x0 * x1 - y0 * y1) (x0 * y1 + x1 * y0)
    negate = fmap negate
    abs = id
    signum = const 1
    fromInteger n = V2 (fromInteger n) 0

instance (Fractional a) => Fractional (Vec2 a) where
    v0@(V2 x0 y0) / v1@(V2 x1 y1) = recip rr *: V2 x y
      where
        !rr = sqrNorm2 v1
        !x = v0 `dot` v1
        !y = v1 `cross` v0
    fromRational q = V2 (fromRational q) 0

infixr 7 *:
(*:) :: Num a => a -> Vec2 a -> Vec2 a
(*:) k = fmap (k*)
{-# INLINE (*:) #-}

dot :: Num a => Vec2 a -> Vec2 a -> a
dot (V2 x0 y0) (V2 x1 y1) = x0 * x1 + y0 * y1
{-# INLINE dot #-}

cross :: Num a => Vec2 a -> Vec2 a -> a
cross (V2 x0 y0) (V2 x1 y1) = x0 * y1 - y0 * x1
{-# INLINE cross #-}

norm1 :: Num a => Vec2 a -> a
norm1 (V2 x y) = abs x + abs y
{-# INLINE norm1 #-}

norm2 :: Floating a => Vec2 a -> a
norm2 = sqrt . sqrNorm2
{-# INLINE norm2 #-}

sqrNorm2 :: Num a => Vec2 a -> a
sqrNorm2 v = v `dot` v
{-# INLINE sqrNorm2 #-}

normSup :: (Num a, Ord a) => Vec2 a -> a
normSup (V2 x y) = abs x `max` abs y
{-# INLINE normSup #-}

normalize :: Floating a => Vec2 a -> Vec2 a
normalize v = recip (norm2 v) *: v
{-# INLINE normalize #-}


lowerBoundDouble :: Double -> Double -> (Double -> Bool) -> Double
lowerBoundDouble low high p = go 50 low high
  where
    go !n !low !high
        | n == 0    = high
        | p mid     = go (n - 1) low mid
        | otherwise = go (n - 1) mid high
      where
        mid = (low + high) * 0.5


-------------------------------------------------------------------------------
-- Utils
-------------------------------------------------------------------------------
rep :: Monad m => Int -> (Int -> m ()) -> m ()
rep !n = U.forM_ $ U.generate n id
{-# INLINE rep #-}
rev :: Monad m => Int -> (Int -> m ()) -> m ()
rev !n = U.forM_ $ U.iterateN n (subtract 1) (n - 1)
{-# INLINE rev #-}
infixl 8 `shiftRL`, `unsafeShiftRL`
shiftRL = unsafeShiftRL
{-# INLINE shiftRL #-}
unsafeShiftRL (I# x#) (I# i#) = I# (uncheckedIShiftRL# x# i#)
{-# INLINE unsafeShiftRL #-}
type Parser a = StateT C.ByteString Maybe a
runParser :: Parser a -> C.ByteString -> Maybe (a, C.ByteString)
runParser = runStateT
{-# INLINE runParser #-}
int :: Parser Int
int = coerce $ C.readInt . C.dropWhile isSpace
{-# INLINE int #-}
int1 :: Parser Int
int1 = fmap (subtract 1) int
{-# INLINE int1 #-}
char :: Parser Char
char = coerce C.uncons
{-# INLINE char #-}
byte :: Parser Word8
byte = coerce B.uncons
{-# INLINE byte #-}


Measured memory_bytes: 1020