let rec solve acc rmax rmin bmax bmin xys =
  if acc <= (rmax - rmin) * (bmax - bmin) then acc
  else
    match xys with
    | [] -> (rmax - rmin) * (bmax - bmin)
    | (x, y) :: rest ->
        solve
          (solve acc
            (max x rmax) (min x rmin)
            (max y bmax) (min y bmin) rest)
          (max y rmax) (min y rmin)
          (max x bmax) (min x bmin) rest

let () = Scanf.scanf "%d\n" @@ fun n ->
  let xys = Array.to_list @@ Array.init n @@ fun _ ->
    Scanf.scanf "%d %d\n" @@ fun x y -> x, y in
  Printf.printf "%d\n" @@ solve max_int 1 1000000000 1 1000000000 xys
