Language: C++

// https://atcoder.jp/contests/abc130/tasks/abc130_f
/*<head>*/
#include "Template.hpp"
/*</head>*/

/*<body>*/
/*</body>*/
int N;
constexpr int S = 112345;
LL x[S], y[S];
int d[S];
int dx[S];
int dy[S];
constexpr LL INF = 1e18;
LL lbx(LL sec) {
    LL ret = INF;
    for (int i : range(N)) {
        chmin(ret, x[i] + sec * dx[d[i]]);
    }
    return ret;
}
LL ubx(LL sec) {
    LL ret = -INF;
    for (int i : range(N)) {
        chmax(ret, x[i] + sec * dx[d[i]]);
    }
    return ret;
}
LL lby(LL sec) {
    LL ret = INF;
    for (int i : range(N)) {
        chmin(ret, y[i] + sec * dy[d[i]]);
    }
    return ret;
}
LL uby(LL sec) {
    LL ret = -INF;
    for (int i : range(N)) {
        chmax(ret, y[i] + sec * dy[d[i]]);
    }
    return ret;
}

int main() {
    cin >> N;
    dx['R'] = dy['U'] = 1;
    dx['L'] = dy['D'] = -1;
    for (int i : range(N)) {
        string s;
        cin >> x[i] >> y[i] >> s;
        x[i] *= 2;
        y[i] *= 2;
        d[i] = s[0];
    }
    vector<LL> X, Y;
    X.push_back(0);
    Y.push_back(0);
    vector<LL> diff = {-2ll, -1ll, 0ll, 1ll, 2ll};
    for (auto df : diff) {
        LL lb = X.back() - 1;
        LL ub = 1e9;
        while (ub - lb > 1) {
            const LL md             = (lb + ub) / 2;
            const LL p              = ubx(md) - lbx(md);
            const LL q              = ubx(md + 1) - lbx(md + 1);
            (q - p == df ? lb : ub) = md;
        }
        X.push_back(ub);
    }

    for (auto df : diff) {
        LL lb = Y.back() - 1;
        LL ub = 1e9;
        while (ub - lb > 1) {
            const LL md             = (lb + ub) / 2;
            const LL p              = uby(md) - lby(md);
            const LL q              = uby(md + 1) - lby(md + 1);
            (q - p == df ? lb : ub) = md;
        }
        Y.push_back(ub);
    }
    X.push_back(1e9);
    Y.push_back(1e9);
    // for (auto xx : X) cerr << xx << " ";
    // cerr << endl;
    // for (auto xx : Y) cerr << xx << " ";
    // cerr << endl;

    double ret = INF;
    for (int i : range(5)) {
        for (int j : range(5)) {
            LL bg     = max(X[i], Y[j]);
            LL ed     = min(X[i + 1], Y[j + 1]);
            double lb = 0;
            double ub = ed - bg;
            if (ed <= bg) continue;
            // cerr << "bg:" << bg << " " << diff[i] << " " << diff[j] << endl;
            // cerr << ubx(bg) - lbx(bg) << " " << uby(bg) - lby(bg) << endl;
            // cerr << "ed:" << ed << endl;
            // cerr << ubx(ed) - lbx(ed) << " " << uby(ed) - lby(ed) << endl;
            double xb = ubx(bg) - lbx(bg);
            double yb = uby(bg) - lby(bg);
            // cerr << xb << " " << yb << endl;
            for (int loop : range(1000)) {
                const double ml = (lb * 2 + ub * 1) / 3.0;
                const double mr = (lb * 1 + ub * 2) / 3.0;
                const double cl = (xb + ml * diff[i]) * (yb + ml * diff[j]);
                const double cr = (xb + mr * diff[i]) * (yb + mr * diff[j]);
                if (cl < cr) {
                    ub = mr;
                }
                else {
                    lb = ml;
                }
                chmin(ret, cl);
            }
        }
    }

    cout << fixed;
    cout << setprecision(10);
    cout << ret / 4 << endl;

    return 0;
}

Compiler output:
a.cc:3:10: fatal error: Template.hpp: No such file or directory
    3 | #include "Template.hpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.