using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (h, w, q) = (c[0], c[1], c[2]); var map = NArr(q); var dic = new Dictionary(); var ans = new List(q); var count = (long)h * w; foreach (var man in map) { if (dic.ContainsKey(man[1] - 1)) { if (man[0] < dic[man[1] - 1]) { count -= dic[man[1] - 1] - man[0]; dic[man[1] - 1] = man[0]; } } else { count -= h - man[0] + 1; dic[man[1] - 1] = man[0]; } ans.Add(count); } WriteLine(string.Join("\n", ans)); } }