#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = maxn * 4 + 10;
const int inf = 1e9;
const long long mod = 1e9 + 7;
int getint() {
  char c;
  while ((c = getchar()) && !(c >= '0' && c <= '9') && c != '-')
    ;
  int ret = c - '0', sgn = 0;
  if (c == '-') sgn = 1, ret = 0;
  while ((c = getchar()) && c >= '0' && c <= '9') ret = ret * 10 + c - '0';
  if (sgn) ret = -ret;
  return ret;
}
multiset<pair<long long, long long> > st1, st2;
multiset<pair<long long, long long> >::iterator it;
vector<pair<long long, long long> > g;
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    int i;
    st1.clear();
    st2.clear();
    for (i = 1; i <= n; i++) {
      long long x1, y1, x2, y2;
      scanf("%I64d%I64d%I64d%I64d", &x1, &y1, &x2, &y2);
      x1 *= 2, y1 *= 2, x2 *= 2, y2 *= 2;
      st1.insert(make_pair((x1 + x2) / 2, (y1 + y2) / 2));
      st2.insert(make_pair((y1 + y2) / 2, (x1 + x2) / 2));
    }
    long long ans = 1e18 + 10;
    for (int i = 0; i <= m; i++) {
      for (int j = 0; j <= m; j++) {
        for (int k = 0; k <= m; k++) {
          for (int l = 0; l <= m; l++) {
            if (i + j + k + l > m) continue;
            g.clear();
            int cnt = 0;
            while (cnt < i && (st1.size())) {
              it = st1.begin();
              int xx = (*it).first, yy = (*it).second;
              g.push_back(make_pair(xx, yy));
              st1.erase(it);
              it = st2.find(make_pair(yy, xx));
              st2.erase(it);
              cnt++;
            }
            cnt = 0;
            while (cnt < j && (st1.size())) {
              it = st1.end();
              it--;
              int xx = (*it).first, yy = (*it).second;
              g.push_back(make_pair(xx, yy));
              st1.erase(it);
              it = st2.find(make_pair(yy, xx));
              st2.erase(it);
              cnt++;
            }
            cnt = 0;
            while (cnt < k && (st2.size())) {
              it = st2.begin();
              int xx = (*it).first, yy = (*it).second;
              g.push_back(make_pair(yy, xx));
              st2.erase(it);
              it = st1.find(make_pair(yy, xx));
              st1.erase(it);
              cnt++;
            }
            cnt = 0;
            while (cnt < l && (st2.size())) {
              it = st2.end();
              it--;
              int xx = (*it).first, yy = (*it).second;
              g.push_back(make_pair(yy, xx));
              st2.erase(it);
              it = st1.find(make_pair(yy, xx));
              st1.erase(it);
              cnt++;
            }
            long long x, y, t1, t2;
            if (st1.size() == 0) {
              ans = 0;
              continue;
            }
            it = st1.begin();
            x = (*it).first;
            it = st1.end();
            it--;
            y = (*it).first;
            t1 = (y - x) / 2;
            t1 = max(t1, (long long)1);
            it = st2.begin();
            x = (*it).first;
            it = st2.end();
            it--;
            y = (*it).first;
            t2 = (y - x) / 2;
            t2 = max(t2, (long long)1);
            ans = min(ans, t1 * t2);
            int len = g.size();
            for (int c = 0; c < len; c++) {
              st1.insert(g[c]);
              st2.insert(make_pair(g[c].second, g[c].first));
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
