#![allow(dead_code, unused_imports, unused_macros, non_snake_case)] use proconio::{ input, input_interactive, marker::{Bytes, Chars, Usize1}, }; fn main() { input! { n: usize, before: [(f64, f64); n], after: [(f64, f64); n], } let bg = before.iter().fold((0.0, 0.0), |(x, y), &(a, b)| { (x + a / n as f64, y + b / n as f64) }); let ag = after.iter().fold((0.0, 0.0), |(x, y), &(a, b)| { (x + a / n as f64, y + b / n as f64) }); let bmaxd = before .iter() .map(|&(a, b)| (a - bg.0).hypot(b - bg.1)) .max_by(|a, b| a.partial_cmp(b).unwrap()) .unwrap(); let amaxd = after .iter() .map(|&(a, b)| (a - ag.0).hypot(b - ag.1)) .max_by(|a, b| a.partial_cmp(b).unwrap()) .unwrap(); println!("{}", amaxd / bmaxd); }