using System.Text; using System.Collections.Generic; using System; public class Hello { public static long h, w; public static int q; static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); h = long.Parse(line[0]); w = long.Parse(line[1]); q = int.Parse(line[2]); getAns(); } static void getAns() { var sb = new StringBuilder(); var ans = h * w; var dw = new Dictionary(); for (int i = 0; i < q; i++) { string[] line = Console.ReadLine().Trim().Split(' '); var x = int.Parse(line[0]) - 1; var y = int.Parse(line[1]) - 1; if (dw.ContainsKey(y)) { if (x < dw[y]) { ans -= dw[y] - x; dw[y] = x; } } else { ans -= h - x; dw[y] = x; } sb.Append(ans.ToString() + "\n"); } Console.Write(sb); } }