fn main() { let mut nm = String::new(); std::io::stdin().read_line(&mut nm).ok(); let nm: Vec = nm.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nm[0]; let m = nm[1]; let mut b = String::new(); std::io::stdin().read_line(&mut b).ok(); let b: Vec = b.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); if m == 1 { println!("{}", n-1); return; } let result = n - b[m-1] + b[0] - 1; let mut summary = vec![0usize; m]; for i in (0..m-1).rev() { summary[i] = summary[i+1] + b[i+1] - b[i]; } let mut sumval = 0usize; let mut minval = (b[m-1] - b[0]) as f64; for i in (1..m).rev() { sumval += summary[i]; let exp = m as f64 / (m - i) as f64; let rest = sumval as f64 / (m - i) as f64; minval = minval.min(exp + rest); } println!("{:.09}", result as f64 + minval); }