macro_rules! read_line_to_tuple { ( $( $t:ty ),* ) => {{ let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* ) }}; } use std::mem::swap; fn main() { let (mut p, mut q, mut r) = read_line_to_tuple!(f64, f64, f64); if p > q { swap(&mut p, &mut q); } if q > r { swap(&mut q, &mut r); } if p > q { swap(&mut p, &mut q); } println!("{:.10}", (q + r) / (p + q + r)); }