#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, int> > X, Y;
vector<int> P;
int k, n;
long long ans = 5000000000000000000LL;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    long long p, q, first, second;
    scanf("%ld%lld%lld%lld", &p, &q, &first, &second);
    p *= 2;
    q *= 2;
    first *= 2;
    second *= 2;
    X.push_back({(p + first) / 2LL, i});
    Y.push_back({(q + second) / 2LL, i});
  }
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  int u = min((int)X.size() - 1, k * 3);
  int v = min((int)Y.size() - 1, k * 3);
  for (int i = 0; i <= u; i++)
    for (int j = 0; j <= u - i; j++)
      for (int m = 0; m <= v; m++)
        for (int l = 0; l <= v - m; l++) {
          if (X.size() - j - 1 < i) continue;
          if (Y.size() - l - 1 < m) continue;
          long long tx = X[X.size() - j - 1].first - X[i].first;
          long long ty = Y[Y.size() - l - 1].first - Y[m].first;
          long long tmp = (tx - 1) / 2LL + 1;
          tmp *= (ty - 1) / 2LL + 1;
          P.clear();
          for (int t = 0; t < i; t++) P.push_back(X[t].second);
          for (int t = 1; t <= j; t++) P.push_back(X[X.size() - t].second);
          for (int t = 0; t < m; t++) P.push_back(Y[t].second);
          for (int t = 1; t <= l; t++) P.push_back(Y[Y.size() - t].second);
          sort(P.begin(), P.end());
          P.resize(unique(P.begin(), P.end()) - P.begin());
          if (P.size() <= k) ans = min(ans, tmp);
        }
  printf("%lld\n", ans);
  return 0;
}
