#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--; auto it = mp.insert({ x, y }); if (it.second) { r -= h - y; } else if (int &t = it.first->second; y < t) { r -= t - y; t = y; } cout << r << '\n'; } return 0; }