#define _CRT_SECURE_NO_WARNINGS #define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING #include using namespace std; const int N = 1e6 + 50; pair a[N]; int main() { int n, m, q; scanf("%d%d%d", &n, &m, &q); int cnt = 0; for (int i = 1; i < n; i++) for (int j = 1; j < m; j++) a[cnt++] = {i, j}; set> S{a, a + cnt}; while (q--) { int x, y; scanf("%d%d", &x, &y); decltype(S)::iterator ite; ite = S.find(make_pair(x, y)); if (ite != S.end()) S.erase(ite); ite = S.find(make_pair(x - 1, y)); if (ite != S.end()) S.erase(ite); ite = S.find(make_pair(x, y - 1)); if (ite != S.end()) S.erase(ite); ite = S.find(make_pair(x - 1, y - 1)); if (ite != S.end()) S.erase(ite); printf("%lld\n", S.size()); } return 0; }