#include #include #include #include using namespace std; using ll = long long; int main(void){ ll h, w, q; cin >> h >> w >> q; ll ans=h*w; map mi; while(q--){ ll y, x; cin >> y >> x; if(mi.count(x)){ ans-=mi[x]-1; mi[x]=min(mi[x], y); } else{ ans-=h; mi[x]=y; } ans+=mi[x]-1; cout << ans << '\n'; } return 0; }