fn main() { let ccount = 999; let csize = 6; let n = ccount * csize + 1; let mut ans = Vec::new(); for offset in (0..ccount).map(|cid| cid * csize) { ans.extend( [(0, 1), (1, 2), (1, 3), (2, 4), (3, 5)] .iter() .map(|(i, j)| (i + offset, j + offset)), ); ans.push((offset, n - 1)); } println!("{n}"); for (x, y) in ans { let x = x + 1; let y = y + 1; println!("{x} {y}"); } }