Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>

using namespace std;
using ll = long long;
using ld = long double;
const ll mod =  1000000007;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define all(x) (x).begin(),(x).end()

ll power(ll base, ll exponent, ll module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ ll root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2, mod);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

const int inf=1e9+7;


double score(
  double xmaxd, double xmaxu, double xmaxc, double xmind, double xminu, double xminc,
  double ymaxd, double ymaxu, double ymaxc, double ymind, double yminu, double yminc) {
    double xmax = max({xmaxd, xmaxu, xmaxc});
    double xmin = min({xmind, xminu, xminc});
    double ymax = max({ymaxd, ymaxu, ymaxc});
    double ymin = min({ymind, yminu, yminc});
    // cout << ymaxd << ":" << ymaxu << ":" << ymaxc << endl;
    // cout << xmax << ":" << xmin << ":" << ymax << ":" << ymin << endl;
    return (xmax - xmin) * (ymax - ymin);
}

signed main() {
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  double xmaxd = -inf, xmaxu = -inf, xmaxc = -inf;
  double xmind = inf, xminu = inf, xminc = inf;
  double ymaxd = -inf, ymaxu = -inf, ymaxc = -inf;
  double ymind = inf, yminu = inf, yminc = inf;
  REP(i, n) {
    double x, y;
    char s;
    cin >> x >> y >> s;
    if(s == 'R') {
      xmaxu = max(xmaxu, x);
      xminu = min(xminu, x);
      ymaxc = max(ymaxc, y);
      yminc = min(yminc, y);
    }
    if(s == 'L') {
      xmaxd = max(xmaxd, x);
      xmind = min(xmind, x);
      ymaxc = max(ymaxc, y);
      yminc = min(yminc, y);
    }
    if(s == 'U') {
      xmaxc = max(xmaxc, x);
      xminc = min(xminc, x);
      ymaxu = max(ymaxu, y);
      yminu = min(yminu, y);
    }
    if(s == 'D') {
      xmaxc = max(xmaxc, x);
      xminc = min(xminc, x);
      ymaxd = max(ymaxd, y);
      ymind = min(ymind, y);
    }
  }
  // cout << xmaxd << ":" << xmaxu << ":" << xmaxc << endl;
  // cout << xmind << ":" << xminu << ":" << xminc << endl;
  // cout << ymaxd << ":" << ymaxu << ":" << ymaxc << endl;
  // cout << ymind << ":" << yminu << ":" << yminc << endl;

  ll length = 4*1e8 + 1;
  double ans = score(xmaxd, xmaxu, xmaxc, xmind, xminu, xminc, ymaxd, ymaxu, ymaxc, ymind, yminu, yminu);
  double x1=xmaxd, x2=xmaxu, x3=xmaxc, x4=xmind, x5=xminu, x6=xminc, y1=ymaxd, y2=ymaxu, y3=ymaxc, y4=ymind, y5=yminu, y6=yminu;
  REP(step, length) {
    double tmp1 = score(
      x1-0.5*step, x2+0.5*step, x3,
       x4-0.5*step, x5+0.5*step, x6,
        y1-0.5*step, y2+0.5*step, y3,
         y4-0.5*step, y5+0.5*step, y6);
    double tmp2 = score(
      xmaxd, xmaxu, xmaxc,
       xmind, xminu, xminc,
        ymaxd, ymaxu, ymaxc,
         ymind, yminu, yminc);
    ans = min(ans, tmp1);
    ans = min(ans, tmp2);
    if(tmp1 != tmp2) {
      cout << "invlid:" << step << ":" << tmp1 << "/" << tmp2 << endl;
    }
    // if(step > 20) {
    //   break;
    // }
    xmaxu += 0.5;
    xminu += 0.5;
    xmaxd -= 0.5;
    xmind -= 0.5;
    ymaxu += 0.5;
    yminu += 0.5;
    ymaxd -= 0.5;
    ymind -= 0.5;
  }
  cout << setprecision(12) << fixed << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:111:11: error: 'setprecision' was not declared in this scope
  111 |   cout << setprecision(12) << fixed << ans << endl;
      |           ^~~~~~~~~~~~
a.cc:8:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    7 | #include <numeric>
  +++ |+#include <iomanip>
    8 |