Language: C++

#include<stdio.h>
#include<math.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<complex>

#define rep(i,n) for(int i=0; i<n;i++)
typedef long long ll;

using namespace std;

ll ans;
int n;
ll vmax= -1000000000;
ll vmin = 1000000000;
ll hmax= -1000000000;
ll hmin = 1000000000;
ll rmax= -1000000000;
ll rmin = 1000000000;
ll lmax= -1000000000;
ll lmin = 1000000000;
ll umax= -1000000000;
ll umin = 1000000000;
ll dmax= -1000000000;
ll dmin = 1000000000;
bool rf,lf,df,uf;
ll rrem;
ll lrem;
ll drem;
ll urem;





int main(){
  cin >> n;
  rep(i,n){
    ll x;
    ll y;
    char d;
    cin >> x >> y >> d;

    if (d == 'U') {umax = max(umax,y);
    umin = min(umin,y);
    }
    else if (d == 'D') {umax = max(dmax,y);
    umin = min(dmin,y);}
    else{    vmax = max(vmax, y);
        vmin = min(vmin, y);

}

    if (d == 'R') {rmax = max(rmax,x);
    rmin = min(rmin,x);}
    else if (d == 'L') {lmax = max(lmax,x);
    lmin = min(lmin,x);}
    else{    hmax = max(hmax, x);
    hmin = min(hmin, x);
}
  }



ans = (vmax-vmin)*(hmax-hmin);
ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));

if (hmax - rmax > 0){
  float time = hmax - rmax;
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;
  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
}
if(lmax - rmax > 0){
    float time = (lmax - rmax)/2;
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;

  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));

}
if(lmax - hmax > 0){
    float time = (lmax - hmax);
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;

  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));

}

if (vmax - umax > 0){
  float time = vmax - umax;
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;
  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
}
if(dmax - umax > 0){
    float time = (dmax - umax)/2;
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;

  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));

}
if(dmax - vmax > 0){
    float time = (dmax - vmax);
  rmaxtmp = rmax+time;
  lmaxtmp = lmax-time;
  rmintmp = rmin+time;
  lmintmp = lmin-time;
  umaxtmp = umax+time;
  dmaxtmp = dmax-time;
  umintmp = umin+time;
  dmintmp = dmin-time;

  ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));

}

cout << ans << endl;

  return 0;
}


Compiler output:
a.cc:31:4: error: 'll drem' redeclared as different kind of entity
   31 | ll drem;
      |    ^~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:220:1: note: previous declaration 'double drem(double, double)'
  220 | __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:68:17: error: 'rmaxtmp' was not declared in this scope; did you mean 'rmax'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                 ^~~~~~~
      |                 rmax
a.cc:68:25: error: 'lmaxtmp' was not declared in this scope; did you mean 'lmax'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                         ^~~~~~~
      |                         lmax
a.cc:68:43: error: 'rmintmp' was not declared in this scope; did you mean 'rmin'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                           ^~~~~~~
      |                                           rmin
a.cc:68:51: error: 'lmintmp' was not declared in this scope
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                   ^~~~~~~
a.cc:68:72: error: 'dmaxtmp' was not declared in this scope; did you mean 'dmax'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                                        ^~~~~~~
      |                                                                        dmax
a.cc:68:80: error: 'umaxtmp' was not declared in this scope; did you mean 'umax'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                                                ^~~~~~~
      |                                                                                umax
a.cc:68:98: error: 'umintmp' was not declared in this scope; did you mean 'umin'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                                                                  ^~~~~~~
      |                                                                                                  umin
a.cc:68:106: error: 'dmintmp' was not declared in this scope; did you mean 'dmin'?
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                                                                          ^~~~~~~
      |                                                                                                          dmin
a.cc:68:115: error: expected ')' before ';' token
   68 | ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                             ~                                                     ^
      |                                                                                                                   )
a.cc:80:117: error: expected ')' before ';' token
   80 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )
a.cc:93:117: error: expected ')' before ';' token
   93 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )
a.cc:107:117: error: expected ')' before ';' token
  107 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )
a.cc:121:117: error: expected ')' before ';' token
  121 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )
a.cc:134:117: error: expected ')' before ';' token
  134 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )
a.cc:148:117: error: expected ')' before ';' token
  148 |   ans = (max(hmax,rmaxtmp,lmaxtmp)-min(hmin,rmintmp,lmintmp))*(max((vmax,dmaxtmp,umaxtmp)-min(vmin,umintmp,dmintmp));
      |                                                               ~                                                     ^
      |                                                                                                                     )