Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int maxx[40007];
- int maxy[40007];
- int c[40007];
- int d[40007];
- long long res=0, n, m, x, y, k, mx, all;
- int main ()
- {
- ios::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- cin>>n>>m>>k;
- for (int i=1; i<=k; i++)
- cin>>c[i]>>d[i];
- c[k+1]=0;
- c[k+2]=n+1;
- d[k+1]=0;
- d[k+2]=m+1;
- k+=2;
- sort(c+1, c+1+k);
- sort(d+1, d+1+k);
- for (int i=1; i<=k; i++) {
- maxx[i]=c[i+1]-c[i];
- maxy[i]=d[i+1]-d[i];
- all=maxx[i]*maxy[i];
- if (all>mx) mx=all;
- }
- cout<<mx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement