Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+17;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int N;
double x[100100], y[100100];
char d[100100];

double area(double t) {
	double xmi = INF, xma = -INF, ymi = INF, yma = -INF;
	rep(i, N) {
		double cx, cy;
		if(d[i] == 'L') {cx = x[i] - t; cy = y[i];}
		else if(d[i] == 'R') {cx = x[i] + t; cy = y[i];}
		else if(d[i] == 'U') {cx = x[i]; cy = y[i] + t;}
		else {cx = x[i]; cy = y[i] - t;}
		chmin(xmi, cx);
		chmax(xma, cx);
		chmin(ymi, cy);
		chmax(yma, cy);
	}
	return (xma - xmi) * (yma - ymi);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    cin >> N;
	rep(i, N) {
		cin >> x[i] >> y[i] >> d[i];
	}
	vector<double> candi;

	double x1 = -INF, x2 = -INF, x3 = -INF;
	rep(i, N) {
		if(d[i] == 'L') {chmax(x3, x[i]);}
		else if(d[i] == 'R') {chmax(x2, x[i]);}
		else if(d[i] == 'U') {chmax(x1, x[i]);}
		else {chmax(x1, x[i]);}
	}
	if(x1 != -INF && x2 != -INF) candi.pb(abs(x1 - x2));
	if(x1 != -INF && x3 != -INF) candi.pb(abs(x1 - x3));
	if(x2 != -INF && x3 != -INF) candi.pb(abs(x2 - x3) / 2);
 
	double x1 = INF, x2 = INF, x3 = INF;
	rep(i, N) {
		if(d[i] == 'L') {chmin(x3, x[i]);}
		else if(d[i] == 'R') {chmin(x2, x[i]);}
		else if(d[i] == 'U') {chmin(x1, x[i]);}
		else {chmin(x1, x[i]);}
	}
	if(x1 != -INF && x2 != -INF) candi.pb(abs(x1 - x2));
	if(x1 != -INF && x3 != -INF) candi.pb(abs(x1 - x3));
	if(x2 != -INF && x3 != -INF) candi.pb(abs(x2 - x3) / 2);

	double y1 = -INF, y2 = -INF, y3 = -INF;
	rep(i, N) {
		if(d[i] == 'L') {chmax(y1, y[i]);}
		else if(d[i] == 'R') {chmax(y1, y[i]);}
		else if(d[i] == 'U') {chmax(y2, y[i]);}
		else {chmax(y3, y[i]);}
	}
	if(y1 != -INF && y2 != -INF) candi.pb(abs(y1 - y2));
	if(y1 != -INF && y3 != -INF) candi.pb(abs(y1 - y3));
	if(y2 != -INF && y3 != -INF) candi.pb(abs(y2 - y3) / 2);

	double y1 = INF, y2 = INF, y3 = INF;
	rep(i, N) {
		if(d[i] == 'L') {chmin(y1, y[i]);}
		else if(d[i] == 'R') {chmin(y1, y[i]);}
		else if(d[i] == 'U') {chmin(y2, y[i]);}
		else {chmin(y3, y[i]);}
	}
	if(y1 != -INF && y2 != -INF) candi.pb(abs(y1 - y2));
	if(y1 != -INF && y3 != -INF) candi.pb(abs(y1 - y3));
	if(y2 != -INF && y3 != -INF) candi.pb(abs(y2 - y3) / 2);

	double ans = INF;
	for(auto t: candi) {
		chmin(ans, area(t));
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:95:16: error: redeclaration of 'double x1'
   95 |         double x1 = INF, x2 = INF, x3 = INF;
      |                ^~
a.cc:84:16: note: 'double x1' previously declared here
   84 |         double x1 = -INF, x2 = -INF, x3 = -INF;
      |                ^~
a.cc:95:26: error: redeclaration of 'double x2'
   95 |         double x1 = INF, x2 = INF, x3 = INF;
      |                          ^~
a.cc:84:27: note: 'double x2' previously declared here
   84 |         double x1 = -INF, x2 = -INF, x3 = -INF;
      |                           ^~
a.cc:95:36: error: redeclaration of 'double x3'
   95 |         double x1 = INF, x2 = INF, x3 = INF;
      |                                    ^~
a.cc:84:38: note: 'double x3' previously declared here
   84 |         double x1 = -INF, x2 = -INF, x3 = -INF;
      |                                      ^~
a.cc:117:16: error: redeclaration of 'double y1'
  117 |         double y1 = INF, y2 = INF, y3 = INF;
      |                ^~
a.cc:106:16: note: 'double y1' previously declared here
  106 |         double y1 = -INF, y2 = -INF, y3 = -INF;
      |                ^~
a.cc:117:26: error: redeclaration of 'double y2'
  117 |         double y1 = INF, y2 = INF, y3 = INF;
      |                          ^~
a.cc:106:27: note: 'double y2' previously declared here
  106 |         double y1 = -INF, y2 = -INF, y3 = -INF;
      |                           ^~
a.cc:117:36: error: redeclaration of 'double y3'
  117 |         double y1 = INF, y2 = INF, y3 = INF;
      |                                    ^~
a.cc:106:38: note: 'double y3' previously declared here
  106 |         double y1 = -INF, y2 = -INF, y3 = -INF;
      |                                      ^~