fn main() { let mut input = String::new(); std::io::stdin().read_line(&mut input).expect("Failed to read line"); let hander:Vec<i32> = input .trim() .split_whitespace() .map(|x| x.parse().expect("Failed to parse number")) .collect(); let N=hander[0]; let M=hander[1]; in...