#include using namespace std; using Int = long long; struct FastIO{ FastIO(){ cin.tie(0); ios::sync_with_stdio(0); } }fastio_beet; //INSERT ABOVE HERE signed main(){ Int h,w,n; cin>>h>>w>>n; vector s(n); vector k(n); for(Int i=0;i>s[i]>>k[i]; reverse(s.begin(),s.end()); reverse(k.begin(),k.end()); Int y=0,x=0; for(Int i=0;i