#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <functional>

using namespace std;

void a()
{
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b)
    {
        cout << c << endl;
    }else if(a == c)
    {
        cout << b << endl;
    } else{
        cout << a << endl;
    }
    return;
}

void b()
{
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for(int i = 0; i < h; i++)
    {
        string temp;
        cin >> temp;
        s[i] = temp;
    }
    for(int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; ++j) {
            int count = 0;
           if(s[i][j] == '.')
           {
               int up, down, right, left;
               up = i > 0 ? i - 1 : -1;
               down = i < h - 1 ? i + 1 : -1;
               right = j < w -1 ? j + 1 : -1;
               left = j > 0 ? j -1 : -1;
               if(up != -1)
               {
                   if(s[up][j] == '#')
                   {
                      count++;
                   }
                   if(right != -1)
                   {
                       if(s[up][right] == '#')
                       {
                           count++;
                       }
                   }
                   if(left != -1)
                   {
                       if(s[up][left] == '#')
                       {
                           count++;
                       }
                   }
               }
               if(down != -1)
               {
                   if(s[down][j] == '#') {
                      count++;
                   }
                   if(right != -1) {
                       if(s[down][right] == '#')
                       {
                           count++;
                       }
                   }
                   if(left != -1)
                   {
                       if(s[down][left] == '#')
                       {
                           count++;
                       }
                   }
               }
               if(right != -1)
               {
                   if(s[i][right] == '#') count++;
               }
               if(left != -1)
               {
                   if(s[i][left] == '#') count++;
               }
               s[i][j] = '0' + count;
           }
        }
    }
    for(int i = 0; i < h; i++)
    {
        for(int j =0; j < w ; j++)
        {
            cout << s[i][j];
        }
        cout << endl;
    }
}

void c()
{
    int n, m;
    cin >> n >> m;
    vector<vector<int>> graph(n);
    for(int i = 0; i < n; i++)
    {
        vector<int> temp;
        graph[i] = temp;
    }
    for(int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        graph[a - 1].push_back(b - 1);
        graph[b - 1].push_back(a - 1);
    }
    stack<vector<int>> stack1;
    vector<int> path;
    path.push_back(0);
    stack1.push(path);
    vector<bool> flags(n, false);
    flags[0] = true;
    int count = 0;
    while(stack1.size() != 0)
    {
        path = stack1.top();
        stack1.pop();
        int endnode = path.back();
        int parent = path[path.size() - 2];
        int pathsize = path.size();
        for(int i = 0; i < graph[endnode].size(); i++)
        {
            int target = graph[endnode][i];
            if(target == parent) continue;
           if(!flags[target])
           {
               path.push_back(target);
               stack1.push(path);
               count++;
               flags[target] = true;
           }else{
               for(int j = 0; j < pathsize; j++)
               {
                   if(path[j] == target)
                   {
                       int circle = path.size() - j;
                       count -= circle;
                       break;
                   }
               }
           }
        }
    }
    cout << count << endl;
}

void d()
{
    typedef long long int ll;
    int n, r;
    cin >> n >> r;
    vector<pair<ll, ll>> points(n);
    vector<bool> points_flag(n, true);
    for(int i = 0; i < n; i++)
    {
        ll x, y;
        cin >> x >> y;
        points[i] = {x, y};
    }
    vector<pair<ll, ll>> points_x(n);
    vector<pair<ll, ll>> points_y(n);
    points_x = points;
    points_y = points;
    sort(points_x.begin(), points_x.end());
    sort(points_y.begin(), points_y.end(),
         [](pair<ll, ll>a, pair<ll, ll>b){
             if(a.second < b.second)
             {
                 return true;
             }else{
                 if(a.second == b.second)
                 {
                     return a.first < b.first;
                 }
                 return false;
             }
         }
    );
    //座標圧縮用の関数
    auto count_unique = [n](vector<pair<ll, ll>> target,vector<pair<ll, ll>> &unique, function<bool(pair<ll, ll> a, pair<ll, ll> b)> check)
    {
        int count = 0;
        for(int i = 0; i < n; i++)
        {
            bool flag = true;
            for(int j = 0; j < n; j++)
            {
                if(i == j) continue;
                if(check(target[i], target[j]))
                {
                    flag = false;
                }
            }
            if(flag) {
                count++;
                unique.push_back(target[i]);
            }
        }
        return count;
    };
    //与えられた長方形内の点の数を数える関数
    auto count_num = [&](ll x1, ll y1, ll x2, ll y2)
    {
        int count = 0;
        for(int i = 0; i < n; i++)
        {
            if(points[i].first >= x1 && points[i].first <= x2 && points[i].second >= y1 && points[i].second <= y2)
            {
                count++;
            }
        }
        return count;
    };
    //異なるxの値を取る点の数を計算
    vector<pair<ll, ll>> unique_x, unique_y;
    int x = count_unique(points_x, unique_x,
                         [](pair<ll, ll> a, pair<ll, ll> b){
                             return a.first == b.first;
                         }
    );
    //異なるyの値を取る点の数を計算
    int y = count_unique(points_y, unique_y,
                         [](pair<ll, ll> a, pair<ll, ll> b){
                             return a.second == b.second;
                         }
    );
    //各ノードに対して自身との差がk以上になるノードを探し面積を計算
    ll area = (unique_x.back().first - unique_x.front().first) * (unique_y.back().second - unique_y.front().second);
    for(int i = 0; i < x - 1; i++)
    {
        for(int j = 0; j < y - 1; j++)
        {
            for(int k = i + 1; k < x; k++)
            {
                for(int l = j + 1; l < y; l++)
                {
                    int num = count_num(unique_x[i].first, unique_y[j].second, unique_x[k].first, unique_y[l].second);
                    if(num >= r)
                    {
                        ll temp = (unique_x[k].first - unique_x[i].first) * (unique_y[l].second - unique_y[j].second);
                        area = temp < area ? temp : area;
                    }
                }
            }
        }
    }
    cout << area << endl;
}

int main() {
    d();
    return 0;
}


Measured memory_bytes: 384