use std::io::*; fn check(x: f64, k: usize, a: &Vec) -> bool { let mut res = 0; for i in 0..a.len() { res += (a[i] / x) as usize; } return res >= k; } fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let k: usize = itr.next().unwrap().parse().unwrap(); let mut l = 0.0; let mut r = 100000000000.0; for _ in 0..1000 { let mid = (l + r) / 2.0; if check(mid, k, &a) { l = mid; } else { r = mid; } } println!("{}", l); }