#include using namespace std; template bool cmin(A& a, B b) { return a > b && (a = b, true); } template bool cmax(A& a, B b) { return a < b && (a = b, true); } signed main() { cin.tie(nullptr)->sync_with_stdio(false); long H, W, Q; cin >> H >> W >> Q; long ans = H * W; map MA; for (long i = 0; i < Q; i++) { long y, x; cin >> y >> x; if (MA.count(x)) { if (y >= MA[x]) { cout << ans << '\n'; } else { ans += H - MA[x] + 1; ans -= H - y + 1; MA[x] = y; cout << ans << '\n'; } } else { ans -= H - y + 1; MA[x] = y; cout << ans << '\n'; } } }