use std::cmp::{min, max}; //TODO fn main() { let mut x = String::new(); std::io::stdin().read_line(&mut x).ok(); let x: usize = x.trim().parse().unwrap(); let mut d: Vec = vec![0; x+1]; for i in 1..x { for j in 1..=x/i { d[i*j] += 1; } } let f: Vec = (0..=x).map(|i| i - d[i]).collect(); let f: Vec = (0..=x).map(|i| max(f[i], f[x-i]) - min(f[i], f[x-i])).collect(); let minval: usize = f.iter().map(|i| *i).min().unwrap(); f.iter().enumerate().for_each(|pair| { let i = *pair.1; let j = pair.0; if i == minval { println!("{} {}", j, x-j); } }); }