Language: C++

using ll = long long;

int main(void){
int n,k;
cin >> n >> k;
vector<int> x(n),y(n);
vector<int> xary,yary;

for(int i = 0; i < n; ++i){
cin >> x[i] >> y[i];
xary.push_back(x[i]);
yary.push_back(y[i]);
}
sort(begin(xary),end(xary));
sort(begin(yary),end(yary));

ll ans = 1LL * (xary[n-1] - xary[0]) * (yary[n-1] - yary[0]);

for(int xi = 0; xi < n; ++xi){
for(int xj = xi + 1; xj < n;++xj){
for(int yi = 0; yi < n; ++yi){
for(int yj = yi + 1; yj < n;++yj){

num = 0;
ll lx = xary[xi],rx = xary[xj];
ll by = yary[yi],uy = yary[yj];

for(int i = 0; i < n;++i){
if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
num++;
}
}

if(num >= k) ans = min(ans,1LL * (rx - lx) * (uy - by));
}
}
}
}

cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin >> n >> k;
      | ^~~
a.cc:6:1: error: 'vector' was not declared in this scope
    6 | vector<int> x(n),y(n);
      | ^~~~~~
a.cc:6:8: error: expected primary-expression before 'int'
    6 | vector<int> x(n),y(n);
      |        ^~~
a.cc:7:8: error: expected primary-expression before 'int'
    7 | vector<int> xary,yary;
      |        ^~~
a.cc:10:8: error: 'x' was not declared in this scope
   10 | cin >> x[i] >> y[i];
      |        ^
a.cc:10:16: error: 'y' was not declared in this scope
   10 | cin >> x[i] >> y[i];
      |                ^
a.cc:11:1: error: 'xary' was not declared in this scope
   11 | xary.push_back(x[i]);
      | ^~~~
a.cc:12:1: error: 'yary' was not declared in this scope
   12 | yary.push_back(y[i]);
      | ^~~~
a.cc:14:12: error: 'xary' was not declared in this scope
   14 | sort(begin(xary),end(xary));
      |            ^~~~
a.cc:14:6: error: 'begin' was not declared in this scope
   14 | sort(begin(xary),end(xary));
      |      ^~~~~
a.cc:14:18: error: 'end' was not declared in this scope
   14 | sort(begin(xary),end(xary));
      |                  ^~~
a.cc:14:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 | sort(begin(xary),end(xary));
      | ^~~~
      | short
a.cc:15:12: error: 'yary' was not declared in this scope
   15 | sort(begin(yary),end(yary));
      |            ^~~~
a.cc:24:1: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 | num = 0;
      | ^~~
      | enum
a.cc:29:10: error: 'x' was not declared in this scope
   29 | if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
      |          ^
a.cc:29:27: error: 'rx' was not declared in this scope; did you mean 'lx'?
   29 | if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
      |                           ^~
      |                           lx
a.cc:29:40: error: 'y' was not declared in this scope
   29 | if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
      |                                        ^
a.cc:29:57: error: 'uy' was not declared in this scope; did you mean 'by'?
   29 | if(lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy){
      |                                                         ^~
      |                                                         by
a.cc:34:35: error: 'rx' was not declared in this scope; did you mean 'lx'?
   34 | if(num >= k) ans = min(ans,1LL * (rx - lx) * (uy - by));
      |                                   ^~
      |                                   lx
a.cc:34:47: error: 'uy' was not declared in this scope; did you mean 'by'?
   34 | if(num >= k) ans = min(ans,1LL * (rx - lx) * (uy - by));
      |                                               ^~
      |                                               by
a.cc:34:20: error: 'min' was not declared in this scope; did you mean 'main'?
   34 | if(num >= k) ans = min(ans,1LL * (rx - lx) * (uy - by));
      |                    ^~~
      |                    main
a.cc:40:1: error: 'cout' was not declared in this scope
   40 | cout << ans << endl;
      | ^~~~
a.cc:40:16: error: 'endl' was not declared in this scope
   40 | cout << ans << endl;
      |                ^~~~