use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let h: usize = itr.next().unwrap().parse().unwrap(); let w: usize = itr.next().unwrap().parse().unwrap(); let q: usize = itr.next().unwrap().parse().unwrap(); let mut ans = h * w; let mut seat: Vec = vec![h; w]; for _ in 0..q { let y = itr.next().unwrap().parse::().unwrap() - 1; let x = itr.next().unwrap().parse::().unwrap() - 1; if y < seat[x] { ans -= seat[x] - y; seat[x] = y; } println!("{}", ans); } }