Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()
#define INF 10101010

struct Maxes
{
  int xmin,xmax;
  int ymin,ymax;
  Maxes():xmin(INF),ymin(INF),xmax(-INF),ymax(-INF) {}
  void compare(x,y) {
    xmin = std::min(xmin,x);
    ymin = std::min(ymin,y);
    xmax = std::max(xmax,x);
    ymax = std::max(ymax,y);
  }
  static int LR(Maxes& L,Maxes& R) {
    if (L.xmin<=R.xmin && L.xmax<=R.xmax) return true;
    return false;
  }
  static int DU(Maxes& L,Maxes& R) {
    if (L.ymin<=R.ymin && L.ymax<=R.ymax) return true;
    return false;
  }
};

signed main() {
  int n;
  std::cin >> n;
  std::vector<Maxes> maxes(4);
  rep(i,n) {
    int x,y;
    char d;
    std::cin >> x >> y >> d;
    if(d=='R') d = 0;
    else if(d=='L') d = 1;
    else if(d=='U') d = 2;
    else if(d=='D') d = 3;
    maxes[d].compare(x,y);
  }
  int a = std::max(maxes[0].xmax,maxes[1].xmax)-std::min(maxes[0].xmin,maxes[1].xmin);
  int b = std::max(maxes[2].xmax,maxes[3].xmax)-std::min(maxes[2].xmin,maxes[3].xmin);
  double t = std::abs(a-b)/4;
  print(std::min(a*b,(std::max(maxes[0].xmax+t*2,maxes[1].xmax+t*2)-std::min(maxes[0].xmin-t*2,maxes[1].xmin-t*2))*(std::max(maxes[2].xmax+t*2,maxes[3].xmax+t*2)-std::min(maxes[2].xmin-t*2,maxes[3].xmin-t*2))));
  return 0;
}

Compiler output:
a.cc:30:16: error: 'x' has not been declared
   30 |   void compare(x,y) {
      |                ^
a.cc:30:18: error: 'y' has not been declared
   30 |   void compare(x,y) {
      |                  ^
a.cc: In member function 'void Maxes::compare(int, int)':
a.cc:31:26: error: 'x' was not declared in this scope
   31 |     xmin = std::min(xmin,x);
      |                          ^
a.cc:32:26: error: 'y' was not declared in this scope; did you mean 'yn'?
   32 |     ymin = std::min(ymin,y);
      |                          ^
      |                          yn
a.cc: In function 'int main()':
a.cc:63:17: error: no matching function for call to 'min(long long int, double)'
   63 |   print(std::min(a*b,(std::max(maxes[0].xmax+t*2,maxes[1].xmax+t*2)-std::min(maxes[0].xmin-t*2,maxes[1].xmin-t*2))*(std::max(maxes[2].xmax+t*2,maxes[3].xmax+t*2)-std::min(maxes[2].xmin-t*2,maxes[3].xmin-t*2))));
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:63:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0].xmax+t*2,maxes[1].xmax+t*2)-std::min(maxes[0].xmin-t*2,maxes[1].xmin-t*2))*(std::max(maxes[2].xmax+t*2,maxes[3].xmax+t*2)-std::min(maxes[2].xmin-t*2,maxes[3].xmin-t*2))));
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:63:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   63 |   print(std::min(a*b,(std::max(maxes[0].xmax+t*2,maxes[1].xmax+t*2)-std::min(maxes[0].xmin-t*2,maxes[1].xmin-t*2))*(std::max(maxes[2].xmax+t*2,maxes[3].xmax+t*2)-std::min(maxes[2].xmin-t*2,maxes[3].xmin-t*2))));
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^