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],maxes[1])-std::min(maxes[0],maxes[1]);
  int b = std::max(maxes[2],maxes[3])-std::min(maxes[2],maxes[3]);
  double t = std::abs(a-b)/4;
  print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-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:60:38: error: no match for 'operator-' (operand types are 'const Maxes' and 'const Maxes')
   60 |   int a = std::max(maxes[0],maxes[1])-std::min(maxes[0],maxes[1]);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |                           |
      |                   const Maxes                 const Maxes
a.cc:61:38: error: no match for 'operator-' (operand types are 'const Maxes' and 'const Maxes')
   61 |   int b = std::max(maxes[2],maxes[3])-std::min(maxes[2],maxes[3]);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |                           |
      |                   const Maxes                 const Maxes
a.cc:63:40: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:53: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:76: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:89: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:114: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:127: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:150: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-t*2))));
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:63:163: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Maxes>, Maxes>::value_type' {aka 'Maxes'} and 'double')
   63 |   print(std::min(a*b,(std::max(maxes[0]+t*2,maxes[1]+t*2)-std::min(maxes[0]-t*2,maxes[1]-t*2))*(std::max(maxes[2]+t*2,maxes[3]+t*2)-std::min(maxes[2]-t*2,maxes[3]-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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = Maxes]':
a.cc:60:19:   required from here
   60 |   int a = std::max(maxes[0],maxes[1])-std::min(maxes[0],maxes[1]);
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:262:15: error: no match for 'operator<' (operand types are 'const Maxes' and 'const Maxes')
  262 |       if (__a < __b)
      |           ~~~~^~~~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  448 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:262:15: note:   'const Maxes' is not derived from 'const std::reverse_iterator<_Iterator>'
  262 |       if (__a < __b)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  493 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:262:15: note:   'const Maxes' is not derived from 'const std::reverse_iterator<_Iterator>'
  262 |       if (__a < __b)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1694 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:262:15: note:   'const Maxes' is not derived from 'const std::move_iterator<_IteratorL>'
  262 |       if (__a < __b)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1760 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:262:15: note:   'const Maxes' is not derived from 'const std::move_iterator<_IteratorL>'
  262 |       if (__a < __b)
      |           ~~~~^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1045 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:262:15: note:   'const Maxes' is not derived from 'const std::pair<_T1, _T2>'
  262 |       if (__a < __b)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = Maxes]':
a.cc:60:47:   required from here
   60 |   int a = std::max(maxes[0],maxes[1])-std::min(maxes[0],maxes[1]);
      |                                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:238:15: error: no match for 'operator<' (operand types are 'const Maxes' and 'const Maxes')
  238 |       if (__b < __a)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  448 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algobase.h:238:15: note:   'const Maxes' is not derived from 'const std::reverse_iterator<_Iterator>'
  238 |       if (__b < __a)
      |           ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterato