#include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll h,w,q; cin >> h >> w >> q; ll res=h*w; map mp; while(q--){ int y,x; cin >> y >> x; if(mp.find(x)==mp.end()){ res-=h; mp[x]=y; res+=mp[x]-1; } else{ if(mp[x]>y){ res-=mp[x]-1; mp[x]=y; res+=mp[x]-1; } } printf("%lld\n",res); } }