let [|h; w; q|] = stdin.ReadLine().Split " " |> Array.map int let seatArr = Array.replicate w (h+1) let mutable available = (int64 h) * (int64 w) for _ in 0..q-1 do let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int let minus = let m = seatArr.[x-1] - y if m < 0 then 0 else m seatArr.[x-1] <- y available <- available - (int64 minus) printfn "%d" available // let arr = // [| // for i in 0..q-1 -> // let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int // x, y // |] |> Array.sort |> Array.rev // // let rec count prev_x value index = // if index = arr.Length then // value // else // let x, y = arr.[index] // if prev_x <> x then // count x (value+y) (index+1) // else // count x value (index+1) // // count -1 0 0 |> printfn "%d"