#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_macros)]
#![allow(unused_variables)]
#![allow(unused_imports)]
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::max($x, max!($($y),+))
    };
}

macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::min($x, max!($($y),+))
    };
}

use std::cmp;
use std::collections::{HashSet, BinaryHeap};
fn main() {
    input! {
        N: usize,
        K: usize,
        positions: [(isize, isize); N],
    }
    let mut K = N - K;
    let mut min_s = std::isize::MAX;
    for max_x_k in 0..K+1 {
        for max_y_k in 0..K+1-max_x_k {
            for min_x_k in 0..K+1-max_x_k-max_y_k {
                let min_y_k = K - max_x_k - max_y_k - min_x_k;
                let mut candidates = positions.clone();
                candidates.sort_by(|pre, next| next.0.cmp(&pre.0));
                let mut candidates = candidates.split_off(max_x_k);
                candidates.sort_by(|pre, next| next.1.cmp(&pre.1));
                let mut candidates = candidates.split_off(max_y_k);
                candidates.sort_by(|pre, next| pre.0.cmp(&next.0));
                let mut candidates = candidates.split_off(min_x_k);
                candidates.sort_by(|pre, next| pre.1.cmp(&next.1));
                let mut candidates = candidates.split_off(min_y_k);
                let mut max_x = std::isize::MIN;
                let mut min_x = std::isize::MAX;
                let mut max_y = max_x;
                let mut min_y = min_x;
                for &(x, y) in candidates.iter() {
                    max_x = cmp::max(max_x, x);
                    min_x = cmp::min(min_x, x);
                    max_y = cmp::max(max_y, y);
                    min_y = cmp::min(min_y, y);
                }
                min_s = cmp::min(min_s, (max_x-min_x)*(max_y - min_y));
            }
        }
    }
    println!("{}", min_s);
}


Measured memory_bytes: 4352