#include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int h, w, q; cin >> h >> w >> q; ll r = (ll)h * w; map mp; while (q--) { int y, x; cin >> y >> x; y--; x--; int t, s = 0; if (mp.count(x) == 0) { s = h; t = mp[x] = y; s -= t; } else { s = mp[x]; t = mp[x] = min(s, y); s -= t; } r -= s; cout << r << '\n'; } return 0; }