Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef struct {
	ll x,y;
} _pos;
int main () {
	int n,K;cin >> n >> K;
	_pos pos[n];for (int i = 0;i < n;i++) {
		cin >> pos[i].x >> pos[i].y;
	}
	ll ans = 1145141919810364364;
	for (int i = 0;i < n;i++) {
		for (int j = i+1;j < n;j++) {
			for (int k = j+1;k < n;k++) {
				for (int l = k+1;l < n;l++) {
					int x[]={pos[i].x,pos[j].x,pos[k].x,pos[l].x};
					int y[]={pos[i].y,pos[j].y,pos[k].y,pos[l].y};
					sort(x,x+4);
					sort(y,y+4);
					int cnt=0;
					for (int m = 0;m < n;m++) {
						if (x[0]<=pos[m].x&&pos[m].x<=x[3]&&y[0]<=pos[m].y&&pos[m].y<=y[3]) {
							cnt++;
						}
					}
					if (cnt>=K) ans = min(ans,(x[3]-x[0])*(y[3]-y[0]));
				}
			}
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:57: warning: narrowing conversion of 'pos[i]._pos::x' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   18 |                                         int x[]={pos[i].x,pos[j].x,pos[k].x,pos[l].x};
      |                                                  ~~~~~~~^
a.cc:18:66: warning: narrowing conversion of 'pos[j]._pos::x' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   18 |                                         int x[]={pos[i].x,pos[j].x,pos[k].x,pos[l].x};
      |                                                           ~~~~~~~^
a.cc:18:75: warning: narrowing conversion of 'pos[k]._pos::x' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   18 |                                         int x[]={pos[i].x,pos[j].x,pos[k].x,pos[l].x};
      |                                                                    ~~~~~~~^
a.cc:18:84: warning: narrowing conversion of 'pos[l]._pos::x' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   18 |                                         int x[]={pos[i].x,pos[j].x,pos[k].x,pos[l].x};
      |                                                                             ~~~~~~~^
a.cc:19:57: warning: narrowing conversion of 'pos[i]._pos::y' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   19 |                                         int y[]={pos[i].y,pos[j].y,pos[k].y,pos[l].y};
      |                                                  ~~~~~~~^
a.cc:19:66: warning: narrowing conversion of 'pos[j]._pos::y' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   19 |                                         int y[]={pos[i].y,pos[j].y,pos[k].y,pos[l].y};
      |                                                           ~~~~~~~^
a.cc:19:75: warning: narrowing conversion of 'pos[k]._pos::y' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   19 |                                         int y[]={pos[i].y,pos[j].y,pos[k].y,pos[l].y};
      |                                                                    ~~~~~~~^
a.cc:19:84: warning: narrowing conversion of 'pos[l]._pos::y' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   19 |                                         int y[]={pos[i].y,pos[j].y,pos[k].y,pos[l].y};
      |                                                                             ~~~~~~~^
a.cc:28:62: error: no matching function for call to 'min(ll&, int)'
   28 |                                         if (cnt>=K) ans = min(ans,(x[3]-x[0])*(y[3]-y[0]));
      |                                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:28:62: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   28 |                                         if (cnt>=K) ans = min(ans,(x[3]-x[0])*(y[3]-y[0]));
      |                                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:28:62: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                                         if (cnt>=K) ans = min(ans,(x[3]-x[0])*(y[3]-y[0]));
      |                                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~