// ${url}
//
#![allow(unused_imports)]
use std::io::*;
use std::io::Write;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

// Input macros.
// Original by tanakh: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, switch) => {
        {
            let ty = read_value!($iter, i32);
            if ty == 1 {
                vec![ty, read_value!($iter, i32), read_value!($iter, i32)]
            } else if ty == 2 {
                vec![ty, read_value!($iter, i32)]
            } else {
                vec![ty, read_value!($iter, i32)]
            }
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! read_line {
    ($t:tt) => {
        {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            s.trim_right().parse::<$t>().unwrap()
        }
    }
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

// ===

type Point = (f64, f64);
type Circle = (f64, f64, f64);


fn dist2(a: &Point, b: &Point) -> f64 {
    let u = a.0-b.0;
    let v = a.1-b.1;
    u*u+v*v
}


const INF: f64 = 1e10;
const EPS: f64 = 1e-9;

fn count(p: &Vec<Circle>, o: Point) -> usize {
    let mut ct = 0;
    for pi in p {
        if dist2(&(pi.0, pi.1), &o) <= pi.2*pi.2+EPS {
            ct += 1;
        }
    }
    ct
}

fn fmax(a: f64, b: f64) -> f64 {
    ifv!(a >= b, a, b)
}

fn rotate(p: &Point, r: f64) -> Point {
    (p.0 * r.cos() - p.1 * r.sin(), p.0 * r.sin() + p.1 * r.cos())
}

fn circle2(a: &Circle, b: &Circle) -> Option<(Point, Point)> {
    let d2 = dist2(&(a.0, a.1), &(b.0, b.1));
    if d2 <= 0.0 {
        return None;
    }
    let d = d2.sqrt();
    if d < (a.2-b.2).abs() {
        return None;
    }
    let r1cos = fmax(0.0, d*d + a.2*a.2 - b.2*b.2) / (2.0*d);
    let uh = (a.2*a.2 - r1cos*r1cos).sqrt();

    let ahe = ((b.0-a.0)/d,(b.1-a.1)/d);
    let up = rotate(&ahe, std::f64::consts::PI/2.0);
    let dw = rotate(&ahe, -std::f64::consts::PI/2.0);
    Some(((a.0+ahe.0*r1cos+up.0*uh, a.1+ahe.1*r1cos+up.1*uh),(a.0+ahe.0*r1cos+dw.0*uh, a.1+ahe.1*r1cos+dw.1*uh)))
}

fn main() {
    input! {
        n: usize, k: usize,
        mut p: [(f64, f64, f64); n]
    };


    let mut ok = INF;
    let mut ng = 0.0;
    for _cur in 0..500 {
        let mut pt = vec![];
        let med = (ok+ng)/2.0;
        let circles = p.iter().cloned().map(|pp| (pp.0, pp.1, med/pp.2)).collect::<Vec<_>>();

        for i in 0..n {
            pt.push((p[i].0, p[i].1));
            for j in 0..n {

                // debug!(circle2(&circles[i], &circles[j]), circle2(&circles[j], &circles[i]));

                if let Some((a, b)) = circle2(&circles[i], &circles[j]) {
                    pt.push(a);
                    pt.push(b);
                }
            }
        }
        let mut includes_k = false;
        for p in pt {
            if count(&circles, p) >= k {
                includes_k = true;
            }
        }
        if includes_k {
            ok = med;
        } else {
            ng = med;
        }
    }
    println!("{:.9}", ok);
}


Measured memory_bytes: 2284