#include #include #define int long long using namespace std; int h, w, q; int y, x; map mp; signed main() { cin >> h >> w >> q; int ans = h * w; for (int i = 0; i < q; i++) { cin >> y >> x; y--; if (mp.find(x) == mp.end()) { mp[x] = y; ans = ans - h + y; } else if (mp[x] > y) { ans = ans + y - mp[x]; mp[x] = y; } cout << ans << endl; } return 0; }