fork download
  1. #include<bits/stdc++.h>
  2. #define ll long long
  3. #define TASK "bai6D"
  4. #define endl '\n'
  5.  
  6. using namespace std;
  7.  
  8. vector<ll> row, col;
  9. ll m, n, k;
  10.  
  11. int main() {
  12. ios_base::sync_with_stdio(0);
  13. cin.tie(0); cout.tie(0);
  14. // freopen(TASK".inp", "r", stdin);
  15. // freopen(TASK".out", "w", stdout);
  16.  
  17. cin >> m >> n >> k;
  18. k *= 4;
  19. for (ll x, y, i = 0; i < k; i++) {
  20. cin >> x >> y;
  21. row.push_back(x);
  22. col.push_back(y);
  23. }
  24. sort(row.begin(), row.end());
  25. sort(col.begin(), col.end());
  26.  
  27. ll rowLine = row[k/2] - row[k/2 - 1];
  28. ll colLine = col[k/2] - col[k/2 - 1];
  29.  
  30. cout << rowLine * colLine;
  31.  
  32.  
  33. cerr << 1.0 * clock() / 1000 << endl;
  34. // for (auto x : prime) cerr << x << " ";
  35.  
  36. return 0;
  37. }
Success #stdin #stdout #stderr 0s 5312KB
stdin
10 4 1
2 1
7 4
6 2
8 3
stdout
1
stderr
4.179