(* n: int ref *)
let n = ref 0

(* k: int ref *)
let k = ref 0

(* pos: (int * int) list ref *)
let pos = ref []

(* sort_x: ('a * 'a) list -> ('a * 'a) list *)
let sort_x lst =
  List.sort (fun (x1, _) (x2, _) -> if x1 < x2 then -1 else 1) lst

(* sort_y: ('a * 'a) list -> ('a * 'a) list *)
let sort_y lst =
  List.sort (fun (_, y1) (_, y2) -> if y1 < y2 then -1 else 1) lst

(* minimum: 'a list -> 'a *)
let minimum lst =
  List.fold_left min max_int lst

(* soi: int -> string *)
let soi = string_of_int
(* pr: int -> unit *)
let pr x = print_endline (soi x)

(* calc_area: (int * int) list -> int *)
let calc_area lst = match lst with
  | [] -> 0
  | _ ->
    (* let _ = if List.length lst <> !k then failwith "err" in *)
    let h (x1, x2, y1, y2) (x, y) =
      (min x1 x, max x2 x, min y1 y, max y2 y)
    in
    let (x_min, x_max, y_min, y_max) =
      List.fold_left h (max_int, min_int, max_int, min_int) lst
    in
    (x_max - x_min) * (y_max - y_min)

(* heads: int -> 'a list -> 'a list *)
let rec heads len l = match l with
  | _ when len = 0 -> []
  | [] -> raise Not_found
  | x :: xs -> x :: (heads (len - 1) xs)

(* get_k_areas: ('a * 'a) list -> int list *)
let rec get_k_areas lst = match lst with
  | [] -> []
  | _ :: xs ->
    if List.length lst < !k then
      []
    else
      let l = heads !k lst in
      (calc_area l) :: (get_k_areas xs)

(* get_areas_on_x: unit -> int list *)
let get_areas_on_x () =
  !pos
  |> sort_x
  |> get_k_areas

(* get_areas_on_y: unit -> int list *)
let get_areas_on_y () =
  !pos
  |> sort_y
  |> get_k_areas

(* main: unit -> int *)
let main () =
  let sq_lst1 = get_areas_on_x () in
  let min1 = minimum sq_lst1 in
  let sq_lst2 = get_areas_on_y () in
  let min2 = minimum sq_lst2 in
  min min1 min2

(* subst: int -> int -> (int * int) list -> unit *)
let subst n_ k_ lst =
  n := n_;
  k := k_;
  pos := lst

(* start: int -> int -> (int * int) list -> unit *)
let start n_ k_ lst =
  subst n_ k_ lst;
  main ()
  |> string_of_int
  |> print_endline

(* test: unit -> unit *)
(*
let test () =
  subst 4 4 [(1, 4); (3, 3); (6, 2); (8, 1)];
  assert (main () == 21);
  subst 4 2 [(0, 0); (1, 1); (2, 2); (3, 3)];
  assert (main () == 1);
  subst 4 3 [(-1000000000, -1000000000);
             (1000000000, 1000000000);
             (-999999999, 999999999);
             (999999999, -999999999)];
  assert (main () == 3999999996000000001)

let _ = test ()
*)
(* read_2int: (int -> int -> 'a) -> 'a *)
let rec read_2int cont =
  Scanf.sscanf (read_line ()) "%d %d" cont

let _ = if true then
  read_2int (fun n_ k_ ->
    let rec h cont acc =
      if List.length acc = n_ then cont acc
      else read_2int (fun a b -> h cont ((a, b) :: acc))
    in
    h (start n_ k_) [])