macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; ( iter = $ iter : ident , $ ( $ r : tt ) * ) => { let s = { use std :: io :: Read ; let mut s = String :: new ( ) ; std :: io :: stdin ( ) . read_to_string ( & mut s ) . unwrap ( ) ; s } ; let mut $ iter = s . split_whitespace ( ) ; input_inner ! { $ iter , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let s = { use std :: io :: Read ; let mut s = String :: new ( ) ; std :: io :: stdin ( ) . read_to_string ( & mut s ) . unwrap ( ) ; s } ; let mut iter = s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; }
macro_rules ! input_inner { ( $ iter : expr ) => { } ; ( $ iter : expr , ) => { } ; ( $ iter : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , mut $ var : ident $ ( $ r : tt ) * ) => { input_inner ! { $ iter , mut $ var : usize $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident $ ( $ r : tt ) * ) => { input_inner ! { $ iter , $ var : usize $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ iter : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ iter , $ t ) ) ,* ) } ; ( $ iter : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ iter , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ iter : expr , { chars : $ base : expr } ) => { read_value ! ( $ iter , String ) . chars ( ) . map ( | c | ( c as u8 - $ base as u8 ) as usize ) . collect ::< Vec < usize >> ( ) } ; ( $ iter : expr , { char : $ base : expr } ) => { read_value ! ( $ iter , { chars : $ base } ) [ 0 ] } ; ( $ iter : expr , chars ) => { read_value ! ( $ iter , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ iter : expr , char ) => { read_value ! ( $ iter , chars ) [ 0 ] } ; ( $ iter : expr , usize1 ) => { read_value ! ( $ iter , usize ) - 1 } ; ( $ iter : expr , $ t : ty ) => { $ iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) } ; }
use std::cmp::{max, min};
fn main() {
    input! { n, xyd: [(i64, i64, char); n] };
    let mut ans = std::i64::MAX;
    let mut ts = vec![0];
    let mut xs = vec![vec![], vec![], vec![]];
    let mut ys = vec![vec![], vec![], vec![]];
    for &(x, y, d) in &xyd {
        let i = match d {
            'R' => 0,
            'L' => 2,
            _ => 1,
        };
        xs[i].push(x);
        let j = match d {
            'U' => 0,
            'D' => 2,
            _ => 1,
        };
        ys[j].push(y);
    }
    if let Some(x1) = xs[0].iter().max() {
        if let Some(x2) = xs[1].iter().max() {
            ts.push((x2 - x1) * 2);
        }
    }
    if let Some(x1) = xs[1].iter().max() {
        if let Some(x2) = xs[2].iter().max() {
            ts.push((x2 - x1) * 2);
        }
    }
    if let Some(x1) = xs[0].iter().max() {
        if let Some(x2) = xs[2].iter().max() {
            ts.push(x2 - x1);
        }
    }
    if let Some(x1) = xs[0].iter().min() {
        if let Some(x2) = xs[1].iter().min() {
            ts.push((x2 - x1) * 2);
        }
    }
    if let Some(x1) = xs[1].iter().min() {
        if let Some(x2) = xs[2].iter().min() {
            ts.push((x2 - x1) * 2);
        }
    }
    if let Some(x1) = xs[0].iter().min() {
        if let Some(x2) = xs[2].iter().min() {
            ts.push(x2 - x1);
        }
    }

    if let Some(y1) = ys[0].iter().max() {
        if let Some(y2) = ys[1].iter().max() {
            ts.push((y2 - y1) * 2);
        }
    }
    if let Some(y1) = ys[1].iter().max() {
        if let Some(y2) = ys[2].iter().max() {
            ts.push((y2 - y1) * 2);
        }
    }
    if let Some(y1) = ys[0].iter().max() {
        if let Some(y2) = ys[2].iter().max() {
            ts.push(y2 - y1);
        }
    }
    if let Some(y1) = ys[0].iter().min() {
        if let Some(y2) = ys[1].iter().min() {
            ts.push((y2 - y1) * 2);
        }
    }
    if let Some(y1) = ys[1].iter().min() {
        if let Some(y2) = ys[2].iter().min() {
            ts.push((y2 - y1) * 2);
        }
    }
    if let Some(y1) = ys[0].iter().min() {
        if let Some(y2) = ys[2].iter().min() {
            ts.push(y2 - y1);
        }
    }

    for t in ts.into_iter() {
        if t < 0 {
            continue;
        }
        let mut xmin = std::i64::MAX;
        let mut xmax = std::i64::MIN;
        let mut ymin = std::i64::MAX;
        let mut ymax = std::i64::MIN;
        for &(x, y, d) in &xyd {
            let (x, y) = match d {
                'R' => (2 * x + t, 2 * y),
                'L' => (2 * x - t, 2 * y),
                'U' => (2 * x, 2 * y + t),
                'D' => (2 * x, 2 * y - t),
                _ => unimplemented!(),
            };
            xmin = min(xmin, x);
            xmax = max(xmax, x);
            ymin = min(ymin, y);
            ymax = max(ymax, y);
        }
        ans = min(ans, (xmax - xmin) * (ymax - ymin));
    }
    println!("{}", ans as f64 / 4.);
}


Measured memory_bytes: 14580