#include // #include #define rng(a) a.begin(),a.end() #define rrng(a) a.rbegin(),a.rend() #define INF 2000000000000000000 #define ll long long #define ld long double #define pll pair using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> H >> W >> Q; ll ans = W * H; map mp; for (ll i = 0; i < Q; ++i) { ll y, x; cin >> y >> x; y -= 1, x -= 1; if (mp.find(x) == mp.end()) { mp[x] = H; } ll before = mp[x]; ll now = y; chmin(mp[x], y); ans -= max(0ll, before - now); cout << ans << "\n"; } }