#include #include using namespace std; int H,W,Q; mapmp; main() { cin>>H>>W>>Q; long ans=(long)H*W; for(;Q--;) { int x,y;cin>>x>>y; if(mp.find(y)==mp.end()) { ans-=H+1-x; mp[y]=x; } else if(mp[y]>x) { ans-=mp[y]-x; mp[y]=x; } cout<