#include #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll H, W, Q; cin >> H >> W >> Q; vector minV(W, H); ll ans = H * W; int y, x; rep(q, Q) { cin >> y >> x; --y; --x; if (minV[x] > y) { ans -= (minV[x] - y); minV[x] = y; } cout << ans << "\n"; } return 0; }