main=do
 [n,k]<-map read.words<$>getLine
 xyc<-map((\[x,y,c]->(x,y,c)).map read.words).lines<$>getContents
 print$f 0.0 1000000.0 xyc k
f l r xyc k
 |r-l<=0.00000001=r
 |otherwise=do
  let m=(l+r)/2
  let xy=(map(\(x,y,c)->(x,y))xyc)++concat[[(ax+ri*cos(t+a),ay+ri*sin(t+a)),(ax+ri*cos(t-a),ay+ri*sin(t-a))]|(ax,ay,ac)<-xyc,(bx,by,bc)<-xyc,let d=(ax-bx)^2+(ay-by)^2,let ri=m/ac,let rj=m/bc,let yy=4*ri^2*d-(ri^2+d-rj^2)^2,yy>=0,let a=atan2(sqrt yy)(ri^2+d-rj^2),let t=atan2(by-ay)(bx-ax)]
  if null(filter(\(tx,ty)->length(filter(\(x,y,c)->(tx-x)^2+(ty-y)^2<(m/c)^2+0.000000001)xyc)>=k)xy) then f m r xyc k else f l m xyc k