use std::env::args; use std::fs::File; use std::io::BufRead; use std::io::BufReader; pub fn iter_input() -> impl Iterator { let path = args().nth(1).unwrap(); let file = File::open(path).unwrap(); return BufReader::new(file).lines().map(|l| l.unwrap()); } #[allow(dead_code)] pub fn div_floor(a: i64, b: i64) -> i64 { let x = a / b; if (b > 0 && x * b > a) || (b < 0 && x * b < a) { return x - 1; } else { return x; } }