program yakiniku_optimization_problem
  implicit none
  real(8), parameter :: tol = 1e-7
  integer :: n, k, i, j
  real(8) :: l = 0.d0, r = 1e6, m, xc, yc, s, t, u, v, w, z, ri, rj
  real(8), dimension(60) :: x = 0.d0, y = 0.d0, c = 0.d0
  character(64) :: ans
  read(*,*) n, k
  do i = 1, n
    read(*,*) x(i), y(i), c(i)
    c(i) = 1.d0 / c(i)
  end do
  do while (r - l > tol)
    m = 0.5 * (l + r)
    do i = 1, n
      if (ok(x(i), y(i))) then
        r = m
        goto 100
      end if
      ri = m * c(i)
      do j = i + 1, n
        rj = m * c(j)
        z = d(x(i), x(j), y(i), y(j))
        if (z > ri + rj .or. z < abs(rj - ri)) cycle
        s = 2 * (x(j) - x(i))
        t = 2 * (y(j) - y(i))
        u = x(i) * x(i) - x(j) * x(j) + y(i) * y(i) - y(j) * y(j) + rj * rj - ri * ri
        v = s * s + t * t
        w = abs(s * x(i) + t * y(i) + u)
        z = sqrt(v * ri * ri - w * w)
        xc = (s * w - t * z) / v + x(i)
        yc = (t * w + s * z) / v + y(i)
        if (ok(xc, yc)) then
          r = m
          goto 100
        end if
        xc = (s * w + t * z) / v + x(i)
        yc = (t * w - s * z) / v + y(i)
        if (ok(xc, yc)) then
          r = m
          goto 100
        end if
      end do
    end do
    l = m
  100 end do
  write(ans,'(f32.16)') r
  write(*,'(a)') trim(adjustl(ans))
contains
  real(8) function d(x1, x2, y1, y2) result(res)
    real(8), intent(in) :: x1, x2, y1, y2
    real(8) :: dx, dy
    dx = x2 - x1
    dy = y2 - y1
    res = sqrt(dx * dx + dy * dy)
  end
  logical function ok(xd, yd) result(res)
    real(8), intent(in) :: xd, yd
    integer :: i, cnt
    cnt = 0
    do i = 1, n
      if (d(xd, x(i), yd, y(i)) <= m * c(i)) cnt = cnt + 1
    end do
    res = cnt >= k
  end
end program yakiniku_optimization_problem