Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int maxx[40007];
  4. int maxy[40007];
  5. int c[40007];
  6. int d[40007];
  7. long long res=0, n, m, x, y, k, mx, all;
  8. int main ()
  9. {
  10. ios::sync_with_stdio(false);
  11. cin.tie(0);
  12. cout.tie(0);
  13. cin>>n>>m>>k;
  14. for (int i=1; i<=k; i++)
  15. cin>>c[i]>>d[i];
  16. c[k+1]=0;
  17. c[k+2]=n+1;
  18. d[k+1]=0;
  19. d[k+2]=m+1;
  20. k+=2;
  21. sort(c+1, c+1+k);
  22. sort(d+1, d+1+k);
  23. for (int i=1; i<=k; i++) {
  24. maxx[i]=c[i+1]-c[i];
  25. maxy[i]=d[i+1]-d[i];
  26. all=maxx[i]*maxy[i];
  27. if (all>mx) mx=all;
  28. }
  29. cout<<mx;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement