#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main(){ ll h,w,q; cin>>h>>w>>q; mapa; ll ans=h*w; for(int i=1;i<=h;i++)a[i]=h+1; rep(i,q){ ll y,x; cin>>y>>x; ll tmp=a[x]; a[x]=min(tmp,y); //cout<