#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
#define PI 3.141592653589793238
#define pq priority_queue<ll>
#define pqr priority_queue<ll,vector<ll>,greater<ll>()>
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  ll n;
  cin>>n;

  ll a[2*n];

  for(ll i=0;i<2*n;i++)
  cin>>a[i];

  if(n==1){
      cout<<"0\n;
      return;
  }
  sort(a,a+2*n);

  ll ans=(a[n-1]-a[0])*(a[2*n-1]-a[n]);

  ll mn=INF;

  ll g=a[2*n-1]-a[0];

  for(ll i=1;i<=n-1;i++){

      mn=min(mn,a[i+n-1]-a[i]);
  }

  g*=mn;

  ans=min(mn,ans);

  cout<<ans<<endl;

}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	int n;
	cin >> n;

	vi A(2 * n);
	for (int &x : A)
		cin >> x;

	sortAll(A);

	cout << (A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]) << "\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	FAST;

	int n;
	cin >> n;

	vi A(2 * n);
	for (int &x : A)
		cin >> x;

	sortAll(A);

	int ans = INT_MAX;
	for (int i = 0; i < n; i++)
		ans = min((A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]), (A[2 * n - 1] - A[0]) * (A[n + i - 1] - A[i]));
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	FAST;

	int n;
	cin >> n;

	vl A(2 * n);
	for (ll &x : A)
		cin >> x;

	sortAll(A);

	ll ans = 1e18;
	for (int i = 0; i < n; i++)
		ans = min(ans, (ll)min((A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]), (A[2 * n - 1] - A[0]) * (A[n + i - 1] - A[i])));
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	FAST;

	int n;
	cin >> n;

	vi A(2 * n);
	for (int &x : A)
		cin >> x;

	sortAll(A);

	ll ans = 1e18;
	for (int i = 0; i < n; i++)
		ans = min(ans, min((A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]), (A[2 * n - 1] - A[0]) * (A[n + i - 1] - A[i])));
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	FAST;

	int n;
	cin >> n;

	vi A(2 * n);
	for (int &x : A)
		cin >> x;

	sortAll(A);

	ll ans = 1e18;
	for (int i = 0; i < n; i++)
		ans = min(ans, (ll)min((A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]), (A[2 * n - 1] - A[0]) * (A[n + i - 1] - A[i])));
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(all(x))
#define sz(x) (int)x.size()
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair< int, int >	pii;
typedef pair< ll, ll >		pl;
typedef vector< int >		vi;
typedef vector< ll >		vl;
typedef vector< pii >		vpii;
typedef vector< pl >		vpl;
typedef vector< vi >		vvi;
typedef vector< vl >		vvl;

const int MOD = 1e9 + 7;

ll power(ll a, ll b)
{
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans *= a;
		a = a * a;
		b >>= 1;
	}
	return ans;
}

ll powm(ll a, ll b)
{
	a %= MOD;
	ll ans = 1;

	while (b > 0)
	{
		if (b & 1)
			ans = (ans * a) % MOD;
		a = (a * a) % MOD;
		b >>= 1;
	}
	return ans;
}

//================================

int main()
{
	FAST;

	int n;
	cin >> n;

	vi A(2 * n);
	for (int &x : A)
		cin >> x;

	sortAll(A);

	int ans = INT_MAX;
	for (int i = 0; i < n; i++)
		ans = min(ans, min((A[n - 1] - A[0]) * (A[2 * n - 1] - A[n]), (A[2 * n - 1] - A[0]) * (A[n + i - 1] - A[i])));
	cout << ans << "\n";
	return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[n * 2 - 1]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));
  for (int i = 2; i < n; i++) {
    ans = min(ans, 1LL * abs(a[i] - a[i + n - 1]) * abs(a[1] - a[n * 2]));
  }
  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  cout << 1LL * abs(a[1] - a[n / 2 + 1]) * abs(a[n / 2] - a[2 * n]);
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  ans = min(ans, abs(a[1] - a[n * 2]) * abs(a[2] * a[n * 2 - 1]));
  ans = min(ans, abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  ans = min(ans, abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  ans = min(ans, abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));

  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  cout << min(1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]), 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[2 * n - 1]));
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  ans = min(ans, abs(a[1] - a[n * 2]) * abs(a[2] * a[n * 2 - 1]));
  ans = min(ans, abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  ans = min(ans, abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  // ans = min(ans, 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[n * 2 - 1]));
  // ans = min(ans, 1LL * abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  // ans = min(ans, 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  // ans = min(ans, 1LL * abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));
  for (int i = 2; i <= n; i++) {
    ans = min(ans, 1LL * abs(a[i] - a[i + n - 1]) * abs(a[1] - a[n * 2]));
  }
  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[n * 2 - 1]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));

  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  cout << 1LL * abs(a[1] - a[n / 2 + 1]) * abs(a[n / 2] - a[n]);
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[n - 2 - 1]));
  ans = min(ans, 1LL * abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  ans = min(ans, 1LL * abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));

  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n;
LL ans, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  ans = 2e18;
  ans = min(ans, 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]));
  // ans = min(ans, 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[n * 2 - 1]));
  // ans = min(ans, 1LL * abs(a[1] - a[n * 2 - 1]) * abs(a[2] - a[n * 2]));
  // ans = min(ans, 1LL * abs(a[2] - a[n * 2]) * abs(a[1] - a[n * 2 - 1]));
  // ans = min(ans, 1LL * abs(a[2] - a[n * 2 - 1]) * abs(a[1] - a[n * 2]));
  for (int i = 2; i < n; i++) {
    ans = min(ans, 1LL * abs(a[i] - a[i + n - 1]) * abs(a[1] - a[n * 2]));
  }
  cout << ans << '\n';
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  cout << min(1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]), 1LL * abs(a[1] - a[n * 2]) * abs(a[2] - a[2 * n - 1]));
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " is " << x << '\n';

typedef long long LL;
typedef pair<int, int> pii;

const int N = 3e5 + 5, M = 1e6, P = 1e9 + 7;

int n, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n + n);
  cout << 1LL * abs(a[1] - a[n]) * abs(a[n + 1] - a[2 * n]);
  return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 1e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = n - 1; i < n + n - 1; ++i) {
		ans = min(ans, (a[i] - x1) * (y2 - a[i + 1]));
	}
//	ans = min(ans, (y2 - x1) * (y1 - x2));
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const int INF = (int) 0x3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    map<int, int>cnt;
    int mx = 0;
   rep(i, 0, 2 * n - 1){
        scanf("%d", &ve[i]);
        cnt[ve[i]] ++;
        mx = max(mx, cnt[ve[i]]);
    }
    if(mx >= n) puts("0");
    else {
        sort(ve.begin(), ve.end());
       // rep(i, 0, 2 * n - 1) printf("%d ", ve[i]);
        n *= 2;
        int mnx = INF, mxx = 0, mny = INF, mxy = 0;
        for(int i = n / 2 - 1; ~i; i--){
            int r = n - i - 1;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ll ans =  abs(mnx - mxx) * 1ll * abs(mny - mxy);
        mnx = INF, mxx = 0, mny = INF, mxy = 0;
        rep(i, 0, n / 2 - 1) {
            int r = i + n / 2;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ans = min(ans, abs(mnx - mxx) * 1ll * abs(mny - mxy));
        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 2e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
//	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = 1; i <= n; ++i) {
		ans = min(ans, (a[i + n - 1] - a[i]) * (y2 - x1));
	}
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const ll INF = (ll) 0x3f3f3f3f3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    rep(i, 0, 2 * n - 1) scanf("%d", &ve[i]);
    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
        ll ans = INF; n *= 2;
        ll t = ve[n - 1];
        ans = min(ans, abs(t - ve[n / 2]) * 1ll * abs(ve[0] - ve[n / 2 - 1]));
        for(int i = 1; i + n / 2 - 1 < n - 1; i++){
            ans = min(ans, abs(t - ve[0]) * 1ll * abs(ve[1] - ve[i + n / 2 - 1]));
        }

        for(int i = n / 2 - 1; i >= 1; i--){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[0] - ve[n / 2]));
        }
        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 2e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = 1; i <= n; ++i) {
		ans = min(ans, (a[i + n] - a[i]) * (y2 - x1));
	}
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const ll INF = (ll) 0x3f3f3f3f3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    rep(i, 0, 2 * n - 1) scanf("%d", &ve[i]);
    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
        ll ans = INF; n *= 2;
        ll t = ve[n - 1];
        ans = min(ans, abs(t - ve[n / 2]) * 1ll * abs(ve[0] - ve[n / 2 - 1]));
        for(int i = 1; i + n / 2 - 1 < n - 1; i++){
            ans = min(ans, abs(t - ve[0]) * 1ll * abs(ve[i] - ve[i + n / 2 - 1]));
        }

        for(int i = n / 2 - 1; i >= 1; i--){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[0] - ve[n / 2]));
        }
        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const int INF = (int) 0x3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    map<int, int>cnt;
    int mx = 0;
    rep(i, 0, 2 * n - 1){
        scanf("%d", &ve[i]);
        cnt[ve[i]] ++;
        mx = max(mx, cnt[ve[i]]);
    }

    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
       // rep(i, 0, 2 * n - 1) printf("%d ", ve[i]);
        n *= 2;
        ll ans;
        /*
        int mnx = INF, mxx = 0, mny = INF, mxy = 0;
        for(int i = n / 2 - 1; ~i; i--){
            int r = n - i - 1;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ans =  abs(mnx - mxx) * 1ll * abs(mny - mxy);
        mnx = INF, mxx = 0, mny = INF, mxy = 0;
        rep(i, 0, n / 2 - 1) {
            int r = i + n / 2;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ans = min(ans, abs(mnx - mxx) * 1ll * abs(mny - mxy));
        */
        ans = INF;
        ll t = ve[n - 1];
        for(int i = n - 2; i >= n / 2; i--){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[i - 1] - ve[0]));
        }

        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const int INF = (int) 0x3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    map<int, int>cnt;
    int mx = 0;
   rep(i, 0, 2 * n - 1){
        scanf("%d", &ve[i]);
        cnt[ve[i]] ++;
        mx = max(mx, cnt[ve[i]]);
    }
    if(mx >= n) puts("0");
    else {
        sort(ve.begin(), ve.end());
       // rep(i, 0, 2 * n - 1) printf("%d ", ve[i]);
        n *= 2;
        int mnx = INF, mxx = 0, mny = INF, mxy = 0;
        for(int i = n / 2 - 1; i >= 0; i--){
            int r = (n / 2) - i - 1 + (n / 2);
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
            //printf("%d %d\n", ve[i], ve[r]);
           //printf("%d %d\n", i, r);
        }

        printf("%lld\n", abs(mnx - mxx) * 1ll * abs(mny - mxy));
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 2e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = 1; i <= n + 1; ++i) {
		ans = min(ans, (a[i + n - 1] - a[i]) * (y2 - x1));
	}
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 2e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = 2; i <= n - 1; ++i) {
		ans = min(ans, (a[i + n] - a[i]) * (y2 - x1));
	}
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const ll INF =  0x3f3f3f3f3f3f3f3f;

int main(){
    //cout<<INF<<"\n";
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    rep(i, 0, 2 * n - 1) scanf("%d", &ve[i]);
    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
         n *= 2;
        ll ans = abs(ve[0] - ve[n / 2 -1]) * 1ll * abs(ve[n / 2] - ve[n - 1]);
        for(int i = 1; i < n / 2; i++){
            ans = min(ans, abs(ve[0] - ve[n - 1]) * 1ll * abs(ve[i] - ve[i + n / 2 - 1]));
        }
        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const int INF = (int) 0x3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    map<int, int>cnt;
    int mx = 0;
    rep(i, 0, 2 * n - 1){
        scanf("%d", &ve[i]);
        cnt[ve[i]] ++;
        mx = max(mx, cnt[ve[i]]);
    }

    if(mx >= n || n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
       // rep(i, 0, 2 * n - 1) printf("%d ", ve[i]);
        n *= 2;
        ll ans;

        int mnx = INF, mxx = 0, mny = INF, mxy = 0;
        for(int i = n / 2 - 1; ~i; i--){
            int r = n - i - 1;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ans =  abs(mnx - mxx) * 1ll * abs(mny - mxy);
        mnx = INF, mxx = 0, mny = INF, mxy = 0;
        rep(i, 0, n / 2 - 1) {
            int r = i + n / 2;
            mnx = min(mnx, ve[i]);
            mxx = max(mxx, ve[i]);

            mny = min(mny, ve[r]);
            mxy = max(mxy, ve[r]);
        }
        ans = min(ans, abs(mnx - mxx) * 1ll * abs(mny - mxy));

        //ans = INF;
        ll t = ve[n - 1];
        for(int i = n - 2; i >= n / 2; i-- ){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[i - 1] - ve[0]));
        }

        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 1e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	ans = min(ans, (y2 - x1) * (y1 - x2));
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 1e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = n; i < n + n - 1; ++i) {
		ans = min(ans, (a[i] - x1) * (y2 - a[i + 1]));
	}
//	ans = min(ans, (y2 - x1) * (y1 - x2));
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const LL mod = 1e9 + 7;
const int MAXN = 1e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n; LL ans = mod * mod;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	ans = min(ans, (y2 - y1) * (x2 - x1));
	for(int i = 2; i <= n - 1; ++i) {
		ans = min(ans, (a[i + n] - a[i]) * (y2 - x1));
	}
	printf("%lld\n", max(ans, 0 * 1ll));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const int INF = (int) 0x3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    rep(i, 0, 2 * n - 1) scanf("%d", &ve[i]);
    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
        ll ans = INF; n *= 2;
        ll t = ve[n - 1];
        ans = min(ans, abs(t - ve[n / 2]) * 1ll * abs(ve[0] - ve[n / 2 - 1]));
        for(int i = 1; i + n / 2 - 1 < n - 1; i++){
            ans = min(ans, abs(t - ve[0]) * 1ll * abs(ve[1] - ve[i + n / 2 - 1]));
        }

        for(int i = n / 2 - 1; i >= 1; i--){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[0] - ve[n / 2]));
        }
        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l; i <= r; i++)

typedef long long ll;
typedef unsigned long long ull;

const int N = (int)2e5 + 11;
const int M = (int)1e6 + 11;
const int MOD = (int)1e9 + 7;
const ll INF =  0x3f3f3f3f3f3f3f3f;

int main(){
    int n; scanf("%d", &n);
    vector<int>ve(2 * n);
    rep(i, 0, 2 * n - 1) scanf("%d", &ve[i]);
    if(n < 2) puts("0");
    else {
        sort(ve.begin(), ve.end());
        ll ans = INF; n *= 2;
        ll t = ve[n - 1];
        ans = min(ans, abs(t - ve[n / 2]) * 1ll * abs(ve[0] - ve[n / 2 - 1]));
        for(int i = n / 2 - 1; i >= 1; i--){
            ans = min(ans, abs(t - ve[i]) * 1ll * abs(ve[0] - ve[n / 2]));
        }
        ans = min(ans, abs(t - ve[0]) * 1ll * abs(ve[1] - ve[n / 2]));

        printf("%lld\n", ans);
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
const int MAXN = 1e5 + 10;
map<int, int> mp1, mp2;
LL a[MAXN];

int main() {
	int n;
	scanf("%d", &n);
	for(int i = 1; i <= n + n; ++i) {
		scanf("%lld", &a[i]);
	}
	sort(a + 1, a + n + n + 1);
	LL x1 = a[1], y1 = a[n + 1], x2 = a[n], y2 = a[n + n];
	printf("%lld\n", (y2 - y1) * (x2 - x1));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long a[1000000],n,ans;
int main(){
    cin>>n;
    for (int i=0;i<n*2;i++) cin>>a[i];
    sort(a,a+n*2);
    ans=(a[n-1]-a[0])*(a[n*2-1]-a[n]);
    for (int i=1;i<n;i++) ans=min(ans,(a[n*2-1]-a[0])*(a[i+n-1]-a[i]));
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e5+5;
int main(){
	int n;
	cin>>n;
	int *a = new int [n*2+1];
	map<int,int>mp;
	bool flag = false;
	for(int i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		int x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		for(int i=0;i<2*n;i++){
			if(a[i]!=x1){
				x2 = a[i];
				break;
			}
		}
		for(int j=2*n-1;j>=0;j--){
			if(a[j]!=x4){
				x3 = a[j];
				break;
			}
		}
		cout<<abs(x2-x1)*abs(x4-x3)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e5+5;
int main(){
	int n;
	cin>>n;
	int *a = new int [n*2+1];
	map<int,int>mp;
	bool flag = false;
	for(int i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		int x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		x2 = a[n-1];x3 = a[n];
		if(mp[x2]+mp[x1]==n&&mp[x3]+mp[x4]==n){
			cout<<min(abs(x2-x1)*abs(x4-x3),abs(x4-x1)*abs(x3-x2))<<endl;
		}
		else
		cout<<abs(x2-x1)*abs(x4-x3)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e5+5;
int main(){
	int n;
	cin>>n;
	int *a = new int [n*2+1];
	map<int,int>mp;
	bool flag = false;
	for(int i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		int x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		x2 = a[n-1];x3 = a[n];
		if(mp.size()==4){
			for(int i=0;i<n*2;i++){
				if(a[i]!=x1){
					x2 = a[i];
					break;
				}
			}
			for(int i=n*2-1;i>=0;i--){
				if(a[i]!=x4){
					x3 = a[i];
					break;
				}
			}
			cout<<min(abs(x2-x1)*abs(x4-x3),abs(x4-x1)*abs(x3-x2))<<endl;
		}
		else
		cout<<abs(x2-x1)*abs(x4-x3)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn = 1e5+5;
int main(){
	ll n;
	cin>>n;
	ll *a = new ll [n*2+1];
	map<ll,ll>mp;
	bool flag = false;
	for(ll i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		ll x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		x2 = a[n-1];x3 = a[n];
		ll temp = abs(x2-x1)*abs(x4-x3);
		for(ll i=0;i<2*n;i++){
			if(a[i]>x1){
				x2 = a[i];
				break;
			}
		}
		for(ll i=2*n-1;i>=0;i--){
			if(a[i]<x4){
				x3 = a[i];
				break;
			}
		}
		ll temp2 = abs(x4-x1)*abs(x3-x2);
		cout<<min(temp2,temp)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e5+5;
int main(){
	int n;
	cin>>n;
	int *a = new int [n*2+1];
	map<int,int>mp;
	bool flag = false;
	for(int i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		int x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		x2 = a[n-1];x3 = a[n];
		if(x2!=x3)
		cout<<min(abs(x2-x1)*abs(x4-x3),abs(x4-x1)*abs(x3-x2))<<endl;
		else{
			cout<<abs(x2-x1)*abs(x4-x3)<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e5+5;
int main(){
	int n;
	cin>>n;
	int *a = new int [n*2+1];
	map<int,int>mp;
	bool flag = false;
	for(int i=0;i<n*2;i++){
		cin>>a[i];
		mp[a[i]]++;
		if(mp[a[i]]>=n){
			flag = true;
		}
	}
	if(flag==true){
		cout<<0<<endl;
	}else{
		sort(a,a+2*n);
		int x1,x2,x3,x4;
		x1 = a[0];x4 = a[2*n-1];
		x2 = a[n-1];x3 = a[n];
		cout<<abs(x2-x1)*abs(x4-x3)<<endl;
	}
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n;ll a[100010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gl();
    sort(a+1,a+2*n+1);
    ll ans=(a[n]-a[1])*(a[n<<1]-a[n+1]);
    for(re int i=1;i<n;i++){
	ans=min(ans,(a[i+n-1]-a[1])*(a[2*n]-a[1]));
    }
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n;ll a[100010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gl();
    sort(a+1,a+2*n+1);
    ll ans=(a[n]-a[1])*(a[n<<1]-a[n+1]);
    for(re int i=2;i<=n;i++){
	ans=min(ans,(a[i+n-1]-a[i])*(a[2*n]-a[1]));
    }
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n,a[100010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gi();
    sort(a+1,a+2*n+1);
    printf("%lld\n",1ll*(a[n]-a[1])*(a[2*n]-a[n+1]));
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n;ll a[100010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gl();
    sort(a+1,a+2*n+1);
    ll ans=1e18;
    for(re int i=1;i<n;i++){
	ans=min(ans,(a[i+n-1]-a[1])*(a[2*n]-a[i+n]));
    }
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n;ll a[1000010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gl();
    sort(a+1,a+2*n+1);
    ll ans=(a[n]-a[1])*(a[n<<1]-a[n+1]);
    for(re int i=2;i<=n;i++){
	ans=min(ans,(a[i+n-1]-a[i])*(a[2*n]-a[1]));
    }
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<queue>
#include<algorithm>
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
inline int gi(){
    int sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
inline ll gl(){
    ll sum=0,f=1;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
    return f*sum;
}
int n;ll a[100010];
int main(){
    n=gi();
    for(re int i=1;i<=2*n;i++)
	a[i]=gl();
    sort(a+1,a+2*n+1);
    ll ans=(a[n]-a[1])*(a[n<<1]-a[n+1]);
    for(re int i=2;i<=n;i++){
	ans=min(ans,(a[i+n-1]-a[1])*(a[2*n]-a[1]));
    }
    printf("%lld\n",ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
typedef long long ll;
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        map<int,int> m;
        bool out0=false;
        for(int i=0;i<n;i++)
        {
            if(m.count(a[i]))m[a[i]]++;else m[a[i]]=1;
            if(m[a[i]]>=n/2)out0=true;
        }
        sort(a,a+n);
        n/=2;
        ll ans1=(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n]);
        ll ans2=(ll)(a[n]-a[0])*(ll)(a[2*n-1]-a[1]);
        ll ans3=(ll)(a[2*n-1]-a[0])*(ll)(a[n]-a[1]);
        ll ans=min(min(ans1,ans2),ans3);
        if(out0)printf("0\n");
        else cout<<ans<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
typedef long long ll;
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        sort(a,a+n);
        n/=2;
        ll ans1=1e18;
        for(int i=1;i+n-1<2*n-1;i++)
        {
            ans1=min(ans1,(ll)(a[2*n-1]-a[0])*(ll)(a[i+n-1]-a[i]));
        }
        ans1=min(ans1,(ll)(a[n-1]-a[0])*(ll)(a[2*n-1]-a[n]));
        cout<<ans1<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        sort(a,a+n);
        n/=2;
        cout<<(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n])<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        map<int,int> m;
        bool out0=false;
        for(int i=0;i<n;i++)
        {
            if(m.count(a[i]))m[a[i]]++;else m[a[i]]=1;
            if(m[a[i]]>=n/2)out0=true;
        }
        sort(a,a+n);
        n/=2;
        if(out0)printf("0\n");
        else cout<<(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n])<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
typedef long long ll;
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        map<int,int> m;
        bool out0=false;
        for(int i=0;i<n;i++)
        {
            if(m.count(a[i]))m[a[i]]++;else m[a[i]]=1;
            if(m[a[i]]>=n/2)out0=true;
        }
        sort(a,a+n);
        n/=2;
        ll ans1=1e18;
        for(int i=1;i+n-1<2*n-1;i++)
        {
            ans1=min(ans1,(a[2*n-1]-a[0])*(a[i+n-1]-a[i]));
        }
//        ll ans1=(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n]);
        ll ans2=(ll)(a[n]-a[0])*(ll)(a[2*n-1]-a[1]);
        ll ans3=(ll)(a[2*n-1]-a[0])*(ll)(a[n]-a[1]);
        ll ans=min(min(ans1,ans2),ans3);
        if(out0)printf("0\n");
        else cout<<ans<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
typedef long long ll;
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        map<int,int> m;
        bool out0=false;
        for(int i=0;i<n;i++)
        {
            if(m.count(a[i]))m[a[i]]++;else m[a[i]]=1;
            if(m[a[i]]>=n/2)out0=true;
        }
        sort(a,a+n);
        n/=2;
        ll ans1=(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n]);
        ll ans2=(ll)(a[n]-a[0])*(ll)(a[2*n-1]-a[1]);
        ll ans3=(ll)(a[2*n-1]-a[0])*(ll)(a[n]-a[1]);
        ll ans=min(min(ans1,ans2),ans3);
        cout<<ans<<endl;
//        if(out0)printf("0\n");
//        else cout<<(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n])<<endl;

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
typedef long long ll;
int main()
{
//    freopen("0.txt","r",stdin);
    int n;while(scanf("%d",&n)==1)
    {
        n*=2;
        for(int i=0;i<n;i++)scanf("%d",&a[i]);
        map<int,int> m;
        bool out0=false;
        for(int i=0;i<n;i++)
        {
            if(m.count(a[i]))m[a[i]]++;else m[a[i]]=1;
            if(m[a[i]]>=n/2)out0=true;
        }
        sort(a,a+n);
        n/=2;
        ll ans1=1e18;
        for(int i=1;i+n-1<2*n-1;i++)
        {
            ans1=min(ans1,(ll)(a[2*n-1]-a[0])*(ll)(a[i+n-1]-a[i]));
        }
//        ll ans1=(long long)(a[n-1]-a[0])*(long long)(a[2*n-1]-a[n]);
        ll ans2=(ll)(a[n]-a[0])*(ll)(a[2*n-1]-a[1]);
        ll ans3=(ll)(a[2*n-1]-a[0])*(ll)(a[n]-a[1]);
        ll ans=min(min(ans1,ans2),ans3);
        if(out0)printf("0\n");
        else cout<<ans<<endl;
    }
    return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000000000000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

   // x=mod;

    sort(a,a+(2*n));
    x=(a[n-1]-a[0])*(a[2*n-1]-a[n]);

    for(i=0;i<=n;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[1]));
    }
//
  //  x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000000000000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    x=mod;

    sort(a,a+(2*n));

    for(i=0;i<=n;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[1]));
    }

    x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000000000000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

   // x=mod;

    sort(a,a+(2*n));
    x=(a[n-1]-a[0])*(a[2*n-1]-a[n]);

    for(i=1;i<n-1;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[0]));
    }
//
  //  x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 100000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    x=INT_MAX;

    sort(a,a+(2*n));

    for(i=0;i<=n;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[1]));
    }

    x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000000000000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

   // x=mod;

    sort(a,a+(2*n));
    x=(a[n-1]-a[0])*(a[2*n-1]-a[n]);

    for(i=1;i<n-1;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[1]));
    }
//
  //  x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    ll x1=mod,y1=mod,x2=0,y2=0;
    std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    sort(a,a+2*n);
    for(i=0;i<n;i++)
    {
      v.pb(mp(a[i],a[n-1-i]));
    }

    sortt(v);
    for(i=0;i<n;i++)
    {
     x1=min(v[i].F,x1);
     x2=max(v[i].F,x2);
     y1=min(v[i].S,x1);
     y2=max(v[i].S,x2);
    }

    cout<<(x2-x1)*(y2-y1);
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 100000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    ll x1=mod,y1=mod,x2=0,y2=0;
    std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    sort(a,a+2*n);
    cout<<(a[n-1]-a[0])*(a[2*n-1]-a[n]);
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000000000000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    //ll x1=mod,y1=mod,x2=0,y2=0;
    //std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

   // x=mod;

    sort(a,a+(2*n));
    x=(a[n-1]-a[0])*(a[2*n-1]-a[n]);

    for(i=1;i<n;i++)
    {
      x=min(x,(a[i+n-1]-a[i])*(a[2*n-1]-a[0]));
    }
//
  //  x=min(x,(a[n-1]-a[0])*(a[2*n-1]-a[n]));
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 100000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    ll x1=mod,y1=mod,x2=0,y2=0;
    std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    sort(a,a+2*n);
    x=(a[n-1]-a[0])*(a[2*n-1]-a[n]);
    cout<<x;
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 100000000
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    ll x1=mod,y1=mod,x2=0,y2=0;
    std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    sort(a,a+2*n);
    for(i=0;i<n;i++)
    {
      v.pb(mp(a[i],a[n-1-i]));
    }

    sortt(v);
    for(i=0;i<n;i++)
    {
     x1=min(v[i].F,x1);
     x2=max(v[i].F,x2);
     y1=min(v[i].S,x1);
     y2=max(v[i].S,x2);
    }

    cout<<(x2-x1)*(y2-y1);
  }
  return 0;
}


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

#define ll long long
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define sortt(v) (sort(v.begin(),v.end()))
#define F first
#define S second

bool cmp(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
       return (a.second < b.second);
}

ll power(ll x,ll y)
{
    ll res = 1;

    x = x;

    if (x == 0) return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x);

        y = y>>1;
        x = (x*x);
    }
    return res;
}

ll power2(ll x,ll y,ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0) return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

int main()
{
//std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);

#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
  ll t=1,i,j,k,x,y,z,n,m,p,l,r,mid;
 // cin>>t;
  while(t--)
  {
    cin>>n;
    ll a[2*n];
    ll x1=mod,y1=mod,x2=0,y2=0;
    std::vector<pair<ll,ll> > v;
    for(i=0;i<(2*n);i++)
    {
      cin>>a[i];
    }

    sort(a,a+2*n);
    for(i=0;i<n;i++)
    {
      v.pb(mp(a[i],a[n-1-i]));
    }

    sortt(v);
    for(i=0;i<n;i++)
    {
     x1=min(v[i].F,x1);
     x2=max(v[i].F,x2);
     y1=min(v[i].S,y1);
     y2=max(v[i].S,y2);
    }

    cout<<(x2-x1)*(y2-y1);
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int x,y,n,a[100005];
long long ans,mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=(a[n/2]-a[1])*(a[n]-a[n/2+1]);
	long long cmp=a[n]-a[1];
	for(int i=1;i<=n/2;i++)
		ans=min(ans,(a[i+n/2-1]-a[i])*cmp);
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int dif[100005],x,y,n,a[100005];
long long ans,mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=(a[n/2-1]-a[1])*(a[n]-a[n/2]);
	for(int i=1;i<=n/2;i++)
		ans=min(ans,(a[i+n/2-1]-a[i])*(long long)(a[n]-a[1]));
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int x,y,n,a[100005];
long long mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	for(int i=2;i<=n;i++)
	{
		if(mini>a[i]-a[i-1])
		{
			mini=a[i]-a[i-1];
			x=a[i];
			y=a[i-1];
		}
	}
	for(int i=2;i<=n;i++)
	{
		if(minu>a[i]-a[i-1]&&a[i]!=x&&a[i]!=y&&a[i-1]!=x&&a[i-1]!=y)
			minu=a[i]-a[i-1];
	}
	printf("%lld",mini*minu);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int dif[100005],x,y,n,a[100005];
long long ans,mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	printf("%d",(a[n/2]-a[1])*(a[n]-a[n/2+1]));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int x,y,n,a[100005];
long long mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	for(int i=2;i<=n;i++)
	{
		if(mini>a[i]-a[i-1])
		{
			mini=a[i]-a[i-1];
			x=i;
			y=i-1;
		}
	}
	for(int i=2;i<=n;i++)
	{
		if(minu>a[i]-a[i-1]&&i!=x&&i!=y&&i-1!=x&&i-1!=y)
			minu=a[i]-a[i-1];
	}
	printf("%lld",mini*minu);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[100005];
long long ans;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=(a[n/2]-a[1])*(a[n]-a[n/2+1]);
	long long cmp=a[n]-a[1];
	for(int i=1;i<=n/2;i++)
		ans=min(ans,cmp*(a[i+n/2-1]-a[i]));
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int dif[100005],x,y,n,a[100005];
long long ans,mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=(a[n/2]-a[1])*(a[n]-a[n/2+1]);
	for(int i=1;i<=n/2;i++)
		ans=min(ans,(a[i+n/2-1]-a[i])*(long long)(a[n]-a[1]));
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[200005];
long long ans;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=((long long)(a[n/2]-a[1]))*(a[n]-a[n/2+1]);
	long long cmp=a[n]-a[1];
	for(int i=1;i<=n/2;i++)
		ans=min(ans,cmp*(a[i+n/2-1]-a[i]));
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int x,y,n,a[100005];
long long mini=0x7fffffff,minu=0x7fffffff;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	for(int i=2;i<=n;i++)
	{
		if(mini>a[i]-a[i-1])
		{
			mini=a[i]-a[i-1];
			x=i;
			y=i-1;
		}
	}
	for(int i=2;i<=n;i++)
	{
		if(minu>a[i]-a[i-1]&&i!=x&&i!=y&&i-1!=x&&i-1!=y)
			minu=a[i]-a[i-1];
	}
	printf("%lld",mini*minu);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[200005];
long long ans;
int main()
{
	scanf("%d",&n);
	n=n*2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	ans=(a[n/2]-a[1])*(a[n]-a[n/2+1]);
	long long cmp=a[n]-a[1];
	for(int i=1;i<=n/2;i++)
		ans=min(ans,cmp*(a[i+n/2-1]-a[i]));
	printf("%lld",ans);
	return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

#define int ll

using namespace std;

int n, m, k;
int a[200005];

main(){
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
    }

    sort(a, a + 2 * n);
    pair<int, int> p[n];
    int min_y = 1e9 + 8, max_y = 0;
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[i + n]);
        min_y = min(min_y, a[i + n]);
        max_y = max(max_y, a[i + n]);
    }
    sort(p, p + n);

    ll ans = (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(max_y - min_y);

    min_y = 1e9 + 8, max_y = 0;
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[2 * n - 1 - i]);
        min_y = min(min_y, a[2 * n - 1 - i]);
        max_y = max(max_y, a[2 * n - 1 - i]);
    }
    sort(p, p + n);

    ans = min(ans, (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(max_y - min_y));

    min_y = 1e9 + 8, max_y = 0;
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i + n], a[i]);
        min_y = min(min_y, a[i]);
        max_y = max(max_y, a[i]);
    }
    sort(p, p + n);
    ans = min(ans, (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(max_y - min_y));

    cout << ans;

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

//#define int ll

using namespace std;

int n, m, k;
int a[200005];
unordered_map<int, int> cnt;

int main()
{
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
        cnt[a[i]]++;
        if (cnt[a[i]] >= n){
            cout << 0;
            return 0;
        }
    }

    sort(a, a + 2 * n);
    cout << 1ll * (a[n - 1] - a[0]) * (a[2 * n - 1] - a[n]);

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

//#define int ll

using namespace std;

int n, m, k;
int a[2002005];
unordered_map<int, int> cnt;

int main()
{
    sync;
    cin >> n;
    bool check = 0;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
        cnt[a[i]]++;
        if (cnt[a[i]] >= n){
            check = 1;
        }
    }

    if (check){
        return cout << 0, 0;
    }

    sort(a, a + 2 * n);

    multiset<int> p, q;
    for(int i = 0;i < 2 * n;i++){
        if (i < n){
            p.insert(a[i]);
        }
        else{
            q.insert(a[i]);
        }
    }

    ll ans = 1ll * (a[n - 1] - a[0]) * (a[2 * n - 1] - a[n]);
    for(int i = n;i < 2 * n;i++){
        p.erase(p.find(a[i - n]));
        p.insert(a[i]);

        q.erase(q.find(a[i]));
        q.insert(a[i - n]);

        int MaxX = *(--p.end()), MaxY = *(--q.end());
        int MinX = *p.begin(), MinY = *q.begin();
        ans = min(ans, 1ll * (MaxX - MinX) * (MaxY - MinY));
        /*cout << MinX << " " << MaxX << endl;
        cout << MinY << " " << MaxY << "\n\n";*/
    }

    cout << ans;

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

//#define int ll

using namespace std;

int n, m, k;
int a[200005];

int main()
{
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
    }

    sort(a, a + 2 * n);
    cout << 1ll * (a[n - 1] - a[0]) * (a[2 * n - 1] - a[n]);

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

#define int ll

using namespace std;

int n, m, k;
int a[200005];

main(){
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
    }

    sort(a, a + 2 * n);
    pair<int, int> p[n];
    int min_y = 1e9 + 8, max_y = 0;
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[i + n]);
        min_y = min(min_y, a[i + n]);
        max_y = max(max_y, a[i + n]);
    }
    sort(p, p + n);

    ll ans = (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(max_y - min_y);

    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[2 * n - 1 - i]);
        min_y = min(min_y, a[2 * n - 1 - i]);
        max_y = max(max_y, a[2 * n - 1 - i]);
    }
    sort(p, p + n);

    ans = min(ans, (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(max_y - min_y));

    cout << ans;

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

#define int ll

using namespace std;

int n, m, k;
int a[200005];

main(){
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
    }

    sort(a, a + 2 * n);
    pair<int, int> p[n];
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[i + n]);
    }
    sort(p, p + n);

    ll ans = (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(p[n - 1].se - p[0].se);

    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[2 * n - 1 - i]);
    }
    sort(p, p + n);
    ans = min(ans, (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(p[n - 1].se - p[0].se));

    cout << ans;

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

//#define int ll

using namespace std;

int n, m, k;
int a[200005];

int main(){
    sync;
    cin >> n;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
    }

    sort(a, a + 2 * n);
    pair<int, int> p[n];
    for(int i = 0;i < n;i++){
        p[i] = mp(a[i], a[i + n]);
    }
    sort(p, p + n);

    cout << (ll)(p[n - 1].fi - p[0].fi) * 1ll * (ll)(p[n - 1].se - p[0].se) << endl;

    return 0;
}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

#define int ll

using namespace std;

int n, m, k;
int a[200005];
unordered_map<int, int> cnt;

 main()
{
    sync;
    cin >> n;
    bool check = 0;
    for(int i = 0;i < 2 * n;i++){
        cin >> a[i];
        cnt[a[i]]++;
        if (cnt[a[i]] >= n){
            check = 1;
        }
    }

    if (check){
        return cout << 0, 0;
    }

    sort(a, a + 2 * n);
    cout << 1ll * (a[n - 1] - a[0]) * (a[2 * n - 1] - a[n]);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e6+5,M=1e4+5;
int a[N];

int main()
{
    int n;
    scanf("%d",&n);
    for (int i=0;i<2*n;i++){
        scanf("%d",a+i);
    }
    sort(a,a+2*n);
    ll x=a[n-1]-a[0];
    ll y=a[2*n-1]-a[n];
    printf("%lld",x*y);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e6+5,M=1e4+5;

int main()
{
    int n;
    scanf("%d",&n);
    int a[2*n];
    for (int i=0;i<2*n;i++){
        scanf("%d",a+i);
    }
    sort(a,a+2*n);
    ll x=a[n-1]-a[0];
    ll y=a[2*n-1]-a[n];
    printf("%lld",x*y);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e6+5,M=1e4+5;
int a[N];
map<int,int> c;
int main()
{
    int n;
    scanf("%d",&n);
    for (int i=0;i<2*n;i++){
        scanf("%d",a+i);
        ++c[a[i]];
        if (c[a[i]]==n) return cout<<"0",0;
    }
    sort(a,a+2*n);
    ll x=a[n-1]-a[0];
    ll y=a[2*n-1]-a[n];
    ll ans=x*y;
    for (int i=0;i<n;i++){
        ans=min(ans,((ll)a[i+n-1]-(ll)a[i])*((ll)a[2*n-1]-(ll)a[0]));
      //  cout<<i<< " "<<((ll)a[i+n-1]-(ll)a[i])*((ll)a[2*n-1]-(ll)a[0])<<endl;
    }
    printf("%lld",ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e6+5,M=1e4+5;
int a[N];
map<int,int> c;
int main()
{
    int n;
    scanf("%d",&n);
    for (int i=0;i<2*n;i++){
        scanf("%d",a+i);
        ++c[a[i]];
        if (c[i]==n) return cout<<"0",0;
    }
    sort(a,a+2*n);
    ll x=a[n-1]-a[0];
    ll y=a[2*n-1]-a[n];
    printf("%lld",x*y);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1e6+5,M=1e4+5;
int a[N];
map<int,int> c;
int main()
{
    int n;
    scanf("%d",&n);
    for (int i=0;i<2*n;i++){
        scanf("%d",a+i);
        ++c[a[i]];
        if (c[a[i]]==n) return cout<<"0",0;
    }
    sort(a,a+2*n);
    ll x=a[n-1]-a[0];
    ll y=a[2*n-1]-a[n];
    printf("%lld",x*y);
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define lli long long int
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define     fix         fixed<<setprecision(10)
#define all(x) x.begin(),x.end()
#define rep(i,a,b) for(int i=a;i<=b;i++)
using namespace std;

void solve(){
	ll n,k;
	cin>>n>>k;
	ll a[n];
	rep(i,0,n-1) cin>>a[i];

	ll ans=INT_MAX;
	int cnt=0;
	rep(i,0,100){
		rep(j,0,n-1){

			if(a[j]!=i){
				j+=(k-1);
				cnt++;
			}

		}
		ans=min(cnt,ans);
	}
	cout<<ans<<"\n";

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	lli testcases;

	cin>>testcases;

	//testcases=1;

	while(testcases--){
		solve();

	}

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define lli long long int
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define     fix         fixed<<setprecision(10)
#define all(x) x.begin(),x.end()
#define rep(i,a,b) for(int i=a;i<=b;i++)
using namespace std;

void solve(){
	ll n,k;
	cin>>n>>k;
	ll a[n];
	map<ll,ll>mp;
	rep(i,0,n-1){
		cin>>a[i];
		mp[a[i]]++;
	}
	ll maxi=0;
	ll e;
	for(auto ele: mp){
		if(maxi<ele.ss){
			maxi=ele.ss;
			e=ele.ff;
		}

	}
	vll v;
	int cnt=0;
	/*int st=-1,en=-1;
	rep(i,0,n-1){
		if(a[i]==e){
			st=i;
			break;
		}
	}
	for(int i=n-1;i>=0;i--){
		if(a[i]==e){
			en=i;
			break;
		}
	}
	rep(i,0,n-1){
		if(a[i]==e){
			if(cnt!=0) v.pb(cnt);
			cnt=0;
		}else{
			cnt++;
		}
	}
	if(cnt!=0){
		v.pb(cnt);
	}
	*/
	rep(i,0,n-1){
		if(a[i]!=e){
			i+=(k-1);
			cnt++;
		}
	}
	cout<<cnt<<"\n";

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	lli testcases;

	cin>>testcases;

	//testcases=1;

	while(testcases--){
		solve();

	}

    return 0;
}


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

#define int  long long
#define tle ios_base::sync_with_stdio(false);cin.tie(NULL);
const int hell=1e9+7;
#define pb push_back

// BHENCHOD TATTE CHEEL GYE

int32_t main()
{
    tle
	int t=1;
	cin>>t;
	while(t--)
	{

	   int n,k;
	   cin>>n>>k;
	   int a[n],ans=0;
	   map<int,int> mp;
	   for(int i=0;i<n;i++)
	   {
	       cin>>a[i];
	       mp[a[i]]++;
	   }
	   int mx=0,val;
	   for(auto x:mp)
	   {
	       mx=max(mx,x.second);
	   }
	   for(auto x:mp)
	   {
	       if(x.second==mx)
	       val=x.first;
	   }
	   int mn=1e18;
	   for(auto x:mp)
	   {
	       ans=0;
    	   for(int i=0;i<n;)
    	   {

    	       if(a[i]!=x.first)
    	       {
    	           ans++;
    	           i+=k;
    	       }
    	       else
    	       i++;

    	   }
    	   mn=min(mn,ans);
	   }

	   cout<<mn<<"\n";

	}
	return 0;
}


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

int main()
{
    int t,n,k;
    cin >> t;
    while(t--)
    {
      cin >> n >> k;
      vector<int>color(n);

      set<int> s;

      for(auto &x:color)
      {
        cin>> x;
        s.insert(x);
      }

      for(int i=0;i<n;i++)
      {
          color[i] = 1 + distance(s.begin(),s.lower_bound(color[i]));

      }
      int ans = INT_MAX;

      for(int i=1;i<=s.size();i++)
      {
          int days=0,cnt=0;

          for(int j=0;j<n;)
          {
              if(color[j]!=i)
              {

                  while(j<n && cnt<k)
                  {
                      cnt++;
                      j++;
                  }

                  days++;
                  cnt=0;

              }
              else
                  j++;

          }

          ans = min(ans,days);
      }
      if(s.size()==1)
        ans = 0;

      cout <<ans<<"\n";

    }
    return 0;
}


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

int main()
{
    int t,n,k;
    cin >> t;
    while(t--)
    {
      cin >> n >> k;
      vector<int>color(n);

      set<int> s;

      for(auto &x:color)
      {
        cin>> x;
        s.insert(x);
      }

      int ans = INT_MAX;

      if(s.size()>1)
      {
          for(int i=1;i<=s.size();i++)
          {
              int days=0,cnt=0;
              for(int j=0;j<n;)
              {
                  if(color[j]!=i)
                  {
                      while(cnt<k && color[j]!=i)
                      {
                          cnt++;
                          j++;
                      }

                      days++;
                      cnt=0;
                  }
                  else
                    j++;

              }
              if(cnt)
              {
                days++;
                ans = min(ans,days);
              }
              ans = min(ans,days);
          }

      }
      else
       ans =0;
      cout <<ans<<"\n";

    }
    return 0;
}


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

int main()
{
    int t,n,k;
    cin >> t;
    while(t--)
    {
      cin >> n >> k;
      vector<int>color(n);

      set<int> s;

      for(auto &x:color)
      {
        cin>> x;
        s.insert(x);
      }

      int ans = INT_MAX;

      for(int i=1;i<=s.size();i++)
      {
          int days=0,cnt=0;
          for(int j=0;j<n;)
          {
              if(color[j]!=i)
              {

                  while(cnt<k)
                  {
                      cnt++;
                      j++;

                  }

                  days++;
                  cnt=0;

              }
              else
                j++;

          }
          ans = min(ans,days);
      }
      if(s.size()==1)
        ans = 0;

      cout <<ans<<"\n";

    }
    return 0;
}


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

int main()
{
    int t,n,p,k,x,y;
    cin >> t;
    while(t--)
    {

      cin >> n >> p >> k;
      string s;
      cin >> s;
      cin >> x >> y;

      int ans =  INT_MAX;
      for(int m=0;m<=n;m++)
      {
          int platforms=0;
          for(int j=0;j<n;j++)
          {
              if((j+1-m-p)>=0 && (j+1-m-p)%k==0)
              {
                  if(s[j]=='0')
                    platforms++;
              }
          }
          int cost = m*y+platforms*x;
          ans=min(ans,cost);
      }
      cout << ans <<"\n";
    }
    return 0;
}


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

int main()
{
    int t,n,k;
    cin >> t;
    while(t--)
    {
      cin >> n >> k;
      vector<int>color(n);

      set<int> s;

      for(auto &x:color)
      {
        cin>> x;
        s.insert(x);
      }

      int ans = INT_MAX;
      for(int i=1;i<=s.size();i++)
      {
          int days=0,cnt=0;
          for(int j=0;j<n;)
          {
              if(color[j]!=i)
              {
                  while(cnt<k && color[j]!=i)
                  {
                      cnt++;
                      j++;
                  }

                  days++;
                  cnt=0;
              }
              else
                j++;

          }
          ans = min(ans,days);
      }

     cout <<ans<<"\n";

    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include<iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#define ll long long
//#define int long long
int cnt = 0;
using namespace std;

int pow(int n, int st){
    int res = 1;
    for (int i = 0; i < st; i++)
        res*=n;
    return res;
}

bool f(int i){
    int a = i&1, b = i&2, c = i&4;
    if (a) a = 1;
    if (b) b = 1;
    if (c) c = 1;
    if (((a & (b^1)) <= (c^1))&(((a|b)^1)<=c)){
        if (i <= 7)
            return true;
        else
            return f(i >> 1);
    }
    return false;
}

void bfs(int i, vector<vector<pair<int, ll>>> &g, vector<int> &used, vector<int> &fuel, int f, ll s, set<int> &res){
    vector<ll> dist(used.size(), 1e9+10);
    dist[i] = 0;
    queue<int> q;
    q.push(i);
    while (q.size()) {
        i = q.front();
        q.pop();
        for (auto j: g[i]) {
            if (dist[i] + j.second <= s && dist[j.first] > dist[i] + j.second) {
//                used[j.first] = 1;
                q.push(j.first);
                dist[j.first] = dist[i] + j.second;
                if (fuel[j.first])
                    fuel[j.first] = 0, dist[j.first] = 0;
            }
        }
        res.insert(i+1);
    }
}

#pragma optimize("", on)
int32_t main() {
    int t;
    cin >> t;
    while (t--){
        int n, k, maxc = 0, maxi;
        cin >> n >> k;
        vector<int> a(n);
//        vector<int> cnt(101, 0);
        for (int i = 0; i < n; i++)
            cin >> a[i];
        /*for (int i = 0; i < 101; i++)
            if (cnt[i] > maxc)
                maxc = cnt[i], maxi = i;*/
        int md = 1e9;
        for (int maxi = 1; maxi <= 100; maxi++)
        {
            int l = 0, d = 0;
            while (l < n){
                if (a[l] == maxi)
                    l++;
                else
                    l+=k, d++;
            }
            md = min(d, md);
        }
        cout << md << endl;
        /*
    int n, p, k;
    cin >> n >> p >> k;
    vector<int> cnt(k);
    vector<int> f(n);
    for (int i = 0; i < n; i++){
        char c;
        cin >> c;
        f[i] = c-'0';
        if (c == '0' && i >= p-1)
            cnt[(i+1-p)%k]++;
    }
    int x, y;
    cin >> x >> y;
    ll minc = 1e17, c =0;
    for (int i = 0; i < n-p; i++){
        minc = min(minc, c+cnt[i%k]*x);
        c+=y;
        if(f[p+i-1] == '0') cnt[p+i-1]--;
    }
    cout << minc << endl;*/
    }
}

/*
3
7 2
1 2 2 1 2 2 1
7 1
1 2 3 4 5 6 7
10 3
1 3 3 3 3 1 2 1 3 3

4
10 3 2
0101010101
2 2
5 4 1
00000
2 10
11 2 3
10110011000
4 3
7 3 2
 0001010
 2 3
 */


#include<bits/stdc++.h>
using namespace std;
#define zhalok Zhalok
#define inf 1e9
#define ll long long int
#define ull unsigned long long
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define negloop(i,a,b) for(ll i=a;i>=b;i--)
#define vi vector<int>
#define vll vector<ll>
#define vull vector<ull>
#define pb push_back
#define be begin()
#define en end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define MOD 1000000007
#define sz 200000
#define ub upper_bound
#define lb lower_bound

ll minn(ll a,ll b)
{
	return a<b?a:b;
}

ll maxx(ll a,ll b)
{
	return a>b?a:b;
}

ll mod_exp(ll a,ll n,ll mod)
{
	if(n==0) return 1;
	if(n%2==0) return (mod_exp(a,n/2,mod)*mod_exp(a,n/2,mod))%mod;
	else return (a*mod_exp(a,n-1,mod))%mod;

}

map<char,bool>mp;

string un(string s)
{
	string ss;
	mp.clear();
	for(int i=0;i<s.size();i++)
	if(mp[s[i]]==false)
	{
		ss.pb(s[i]);
		mp[s[i]]=true;
	}

	sort(ss.begin(),ss.end());
	return ss;
}

vector<string> precal()
{

vector<string>pc;
string temp;

for(int i=0;i<26;i++)
{
	for(int j=i+1;j<26;j++)
	{
		temp.clear();
		temp.pb(i+'a');
		temp.pb(j+'a');
		pc.pb(temp);
	}
}

return pc;

}

ll how_many_substring(string s,string sub)
{
	ll cnt=0;
	loop(i,0,(s.size()-sub.size())+1)
	{
		bool flag=true;
		for(int k=i,j=0;j<sub.size();j++,k++)
		if(s[k]!=sub[j])
		{
			flag=false;
			break;
		}
		if(flag)
		cnt++;
	}
	return cnt;
}

ll sum_of_digits(ll n)

{
	ll sum=0;
	while(n)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}

/*

int x;
int y;
int d;

void extendedEuclid(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}

*/

ll cill(ll a,ll b)
{
	if(a%b==0)
	return a/b;
	return a/b+1;
	}

//vll v;

/*void solve()
{

ll x,y;
cin>>x>>y;
cout<<(minn(x,y)*2+1+(maxx(x,y)-2*minn(x,y))*2)<<endl;

}
*/

ll gcd(ll a,ll b)
{
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

ll check(ll n,ll k)
{
	vi v;

	while(n)
	{
		if(n%k>1) return -1;

		v.pb(n%k);
		n/=k;

	}

	reverse(v.begin(),v.end());
	ll sum=0;
	for(int i=0;i<v.size();i++)
	{
		sum*=2;
		sum+=v[i];
	}

	return sum;

}

vll take_input(ll n)
{
	vll v;

	loop(i,0,n)
	{
		ll x;
		cin>>x;
		v.pb(x);
	}

	return v;
}

map<char,int>counter;
string s;
int unn;

bool check(int len)
{
	counter.clear();
	int un=0;
	int i=0;
	int j=len-1;
	for(int x=i;x<=j;x++)
	{

	if(counter[s[x]]==0) un++;
    counter[s[x]]++;
}

if(un==unn) return true;

while(j<s.size()-1)
{
	if(counter[s[i]]==1) un--;
	counter[s[i]]--;

	i++;
	j++;

	if(counter[s[j]]==0)
	un++;
	counter[s[j]]++;

	if(un==unn)
	return true;
}

return false;

}

void solve()
{
int n,k;
cin>>n>>k;
vll v;
v=take_input(n);
vpll temp;
map<ll,ll>counter;
for(int i=0;i<v.size();i++)
counter[v[i]]++;
for(int i=0;i<v.size();i++)
temp.pb({counter[v[i]],v[i]});

sort(temp.begin(),temp.end(),greater<pll>());

ll ref=temp[0].ss;

int i=0;
int j=k;

ll ans=0;
for(int x=i;x<=j;x++)
if(v[x]!=ref) {
	ans++;
	break;
}

while(j<v.size()-1)
{
	if(v[i]!=ref&&v[j+1]!=ref)
	ans++;
	i++;
	j++;

}

cout<<ans+1<<endl;

}

int main()
{

int t;
cin>>t;
while(t--)
solve();

}


#include<bits/stdc++.h>
using namespace std;
#define zhalok Zhalok
#define inf 1e9
#define ll long long int
#define ull unsigned long long
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define negloop(i,a,b) for(ll i=a;i>=b;i--)
#define vi vector<int>
#define vll vector<ll>
#define vull vector<ull>
#define pb push_back
#define be begin()
#define en end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define MOD 1000000007
#define sz 200000
#define ub upper_bound
#define lb lower_bound

ll minn(ll a,ll b)
{
	return a<b?a:b;
}

ll maxx(ll a,ll b)
{
	return a>b?a:b;
}

ll mod_exp(ll a,ll n,ll mod)
{
	if(n==0) return 1;
	if(n%2==0) return (mod_exp(a,n/2,mod)*mod_exp(a,n/2,mod))%mod;
	else return (a*mod_exp(a,n-1,mod))%mod;

}

map<char,bool>mp;

string un(string s)
{
	string ss;
	mp.clear();
	for(int i=0;i<s.size();i++)
	if(mp[s[i]]==false)
	{
		ss.pb(s[i]);
		mp[s[i]]=true;
	}

	sort(ss.begin(),ss.end());
	return ss;
}

vector<string> precal()
{

vector<string>pc;
string temp;

for(int i=0;i<26;i++)
{
	for(int j=i+1;j<26;j++)
	{
		temp.clear();
		temp.pb(i+'a');
		temp.pb(j+'a');
		pc.pb(temp);
	}
}

return pc;

}

ll how_many_substring(string s,string sub)
{
	ll cnt=0;
	loop(i,0,(s.size()-sub.size())+1)
	{
		bool flag=true;
		for(int k=i,j=0;j<sub.size();j++,k++)
		if(s[k]!=sub[j])
		{
			flag=false;
			break;
		}
		if(flag)
		cnt++;
	}
	return cnt;
}

ll sum_of_digits(ll n)

{
	ll sum=0;
	while(n)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}

/*

int x;
int y;
int d;

void extendedEuclid(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}

*/

ll cill(ll a,ll b)
{
	if(a%b==0)
	return a/b;
	return a/b+1;
	}

//vll v;

/*void solve()
{

ll x,y;
cin>>x>>y;
cout<<(minn(x,y)*2+1+(maxx(x,y)-2*minn(x,y))*2)<<endl;

}
*/

ll gcd(ll a,ll b)
{
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

ll check(ll n,ll k)
{
	vi v;

	while(n)
	{
		if(n%k>1) return -1;

		v.pb(n%k);
		n/=k;

	}

	reverse(v.begin(),v.end());
	ll sum=0;
	for(int i=0;i<v.size();i++)
	{
		sum*=2;
		sum+=v[i];
	}

	return sum;

}

vll take_input(ll n)
{
	vll v;

	loop(i,0,n)
	{
		ll x;
		cin>>x;
		v.pb(x);
	}

	return v;
}

map<char,int>counter;
string s;
int unn;

bool check(int len)
{
	counter.clear();
	int un=0;
	int i=0;
	int j=len-1;
	for(int x=i;x<=j;x++)
	{

	if(counter[s[x]]==0) un++;
    counter[s[x]]++;
}

if(un==unn) return true;

while(j<s.size()-1)
{
	if(counter[s[i]]==1) un--;
	counter[s[i]]--;

	i++;
	j++;

	if(counter[s[j]]==0)
	un++;
	counter[s[j]]++;

	if(un==unn)
	return true;
}

return false;

}

void solve()
{

int n,k;
cin>>n>>k;

vll v,v1;

map<ll,bool>visited;

for(int i=0;i<n;i++)
{
	ll x;
	cin>>x;
	v.pb(x);
	if(visited[x]==false)
	v1.pb(x);

	visited[x]=true;

}

ll ans=inf;

for(int i=0;i<v1.size();i++)
{
	ll tans=0;
	int j=0;
	while(j<n)
	{
		if(v[j]!=v1[i])
		{
			tans++;
			j+=k;
		}
		else j++;
	}

	ans=minn(ans,tans);
}

cout<<ans<<endl;

}

int main()
{

int t;
cin>>t;
while(t--)
solve();

}


#include<bits/stdc++.h>
using namespace std;
#define zhalok Zhalok
#define inf 1e9
#define ll long long int
#define ull unsigned long long
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define negloop(i,a,b) for(ll i=a;i>=b;i--)
#define vi vector<int>
#define vll vector<ll>
#define vull vector<ull>
#define pb push_back
#define be begin()
#define en end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define MOD 1000000007
#define sz 200000
#define ub upper_bound
#define lb lower_bound

ll minn(ll a,ll b)
{
	return a<b?a:b;
}

ll maxx(ll a,ll b)
{
	return a>b?a:b;
}

ll mod_exp(ll a,ll n,ll mod)
{
	if(n==0) return 1;
	if(n%2==0) return (mod_exp(a,n/2,mod)*mod_exp(a,n/2,mod))%mod;
	else return (a*mod_exp(a,n-1,mod))%mod;

}

map<char,bool>mp;

string un(string s)
{
	string ss;
	mp.clear();
	for(int i=0;i<s.size();i++)
	if(mp[s[i]]==false)
	{
		ss.pb(s[i]);
		mp[s[i]]=true;
	}

	sort(ss.begin(),ss.end());
	return ss;
}

vector<string> precal()
{

vector<string>pc;
string temp;

for(int i=0;i<26;i++)
{
	for(int j=i+1;j<26;j++)
	{
		temp.clear();
		temp.pb(i+'a');
		temp.pb(j+'a');
		pc.pb(temp);
	}
}

return pc;

}

ll how_many_substring(string s,string sub)
{
	ll cnt=0;
	loop(i,0,(s.size()-sub.size())+1)
	{
		bool flag=true;
		for(int k=i,j=0;j<sub.size();j++,k++)
		if(s[k]!=sub[j])
		{
			flag=false;
			break;
		}
		if(flag)
		cnt++;
	}
	return cnt;
}

ll sum_of_digits(ll n)

{
	ll sum=0;
	while(n)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}

/*

int x;
int y;
int d;

void extendedEuclid(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}

*/

ll cill(ll a,ll b)
{
	if(a%b==0)
	return a/b;
	return a/b+1;
	}

//vll v;

/*void solve()
{

ll x,y;
cin>>x>>y;
cout<<(minn(x,y)*2+1+(maxx(x,y)-2*minn(x,y))*2)<<endl;

}
*/

ll gcd(ll a,ll b)
{
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

ll check(ll n,ll k)
{
	vi v;

	while(n)
	{
		if(n%k>1) return -1;

		v.pb(n%k);
		n/=k;

	}

	reverse(v.begin(),v.end());
	ll sum=0;
	for(int i=0;i<v.size();i++)
	{
		sum*=2;
		sum+=v[i];
	}

	return sum;

}

vll take_input(ll n)
{
	vll v;

	loop(i,0,n)
	{
		ll x;
		cin>>x;
		v.pb(x);
	}

	return v;
}

map<char,int>counter;
string s;
int unn;

bool check(int len)
{
	counter.clear();
	int un=0;
	int i=0;
	int j=len-1;
	for(int x=i;x<=j;x++)
	{

	if(counter[s[x]]==0) un++;
    counter[s[x]]++;
}

if(un==unn) return true;

while(j<s.size()-1)
{
	if(counter[s[i]]==1) un--;
	counter[s[i]]--;

	i++;
	j++;

	if(counter[s[j]]==0)
	un++;
	counter[s[j]]++;

	if(un==unn)
	return true;
}

return false;

}

void solve()
{
int n,k;
cin>>n>>k;
vll v;
v=take_input(n);
vpll temp;
map<ll,ll>counter;
for(int i=0;i<v.size();i++)
counter[v[i]]++;
for(int i=0;i<v.size();i++)
temp.pb({counter[v[i]],v[i]});

sort(temp.begin(),temp.end(),greater<pll>());

ll ref=temp[0].ss;

ll ans=0;
int i=0;
while(i<n)
{
	if(v[i]!=ref) {
		ans++;
		i+=k;
	}
	else i++;
}

cout<<ans<<endl;

}

int main()
{

int t;
cin>>t;
while(t--)
solve();

}


#include<bits/stdc++.h>
using namespace std;
#define zhalok Zhalok
#define inf 1e9
#define ll long long int
#define ull unsigned long long
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define negloop(i,a,b) for(ll i=a;i>=b;i--)
#define vi vector<int>
#define vll vector<ll>
#define vull vector<ull>
#define pb push_back
#define be begin()
#define en end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define MOD 1000000007
#define sz 200000
#define ub upper_bound
#define lb lower_bound

ll minn(ll a,ll b)
{
	return a<b?a:b;
}

ll maxx(ll a,ll b)
{
	return a>b?a:b;
}

ll mod_exp(ll a,ll n,ll mod)
{
	if(n==0) return 1;
	if(n%2==0) return (mod_exp(a,n/2,mod)*mod_exp(a,n/2,mod))%mod;
	else return (a*mod_exp(a,n-1,mod))%mod;

}

map<char,bool>mp;

string un(string s)
{
	string ss;
	mp.clear();
	for(int i=0;i<s.size();i++)
	if(mp[s[i]]==false)
	{
		ss.pb(s[i]);
		mp[s[i]]=true;
	}

	sort(ss.begin(),ss.end());
	return ss;
}

vector<string> precal()
{

vector<string>pc;
string temp;

for(int i=0;i<26;i++)
{
	for(int j=i+1;j<26;j++)
	{
		temp.clear();
		temp.pb(i+'a');
		temp.pb(j+'a');
		pc.pb(temp);
	}
}

return pc;

}

ll how_many_substring(string s,string sub)
{
	ll cnt=0;
	loop(i,0,(s.size()-sub.size())+1)
	{
		bool flag=true;
		for(int k=i,j=0;j<sub.size();j++,k++)
		if(s[k]!=sub[j])
		{
			flag=false;
			break;
		}
		if(flag)
		cnt++;
	}
	return cnt;
}

ll sum_of_digits(ll n)

{
	ll sum=0;
	while(n)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}

/*

int x;
int y;
int d;

void extendedEuclid(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}

*/

ll cill(ll a,ll b)
{
	if(a%b==0)
	return a/b;
	return a/b+1;
	}

//vll v;

/*void solve()
{

ll x,y;
cin>>x>>y;
cout<<(minn(x,y)*2+1+(maxx(x,y)-2*minn(x,y))*2)<<endl;

}
*/

ll gcd(ll a,ll b)
{
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

ll check(ll n,ll k)
{
	vi v;

	while(n)
	{
		if(n%k>1) return -1;

		v.pb(n%k);
		n/=k;

	}

	reverse(v.begin(),v.end());
	ll sum=0;
	for(int i=0;i<v.size();i++)
	{
		sum*=2;
		sum+=v[i];
	}

	return sum;

}

vll take_input(ll n)
{
	vll v;

	loop(i,0,n)
	{
		ll x;
		cin>>x;
		v.pb(x);
	}

	return v;
}

map<char,int>counter;
string s;
int unn;

bool check(int len)
{
	counter.clear();
	int un=0;
	int i=0;
	int j=len-1;
	for(int x=i;x<=j;x++)
	{

	if(counter[s[x]]==0) un++;
    counter[s[x]]++;
}

if(un==unn) return true;

while(j<s.size()-1)
{
	if(counter[s[i]]==1) un--;
	counter[s[i]]--;

	i++;
	j++;

	if(counter[s[j]]==0)
	un++;
	counter[s[j]]++;

	if(un==unn)
	return true;
}

return false;

}

void solve()
{

int n,k;
cin>>n>>k;

vll v;

for(int i=0;i<n;i++)
{
	ll x;
	cin>>x;
	v.pb(x);

}

ll ans=inf;

for(int i=1;i<=100;i++)
{
	ll tans=0;
	int j=0;
	while(j<n)
	{
		if(v[j]!=i)
		{
			tans++;
			j+=k;
		}
		else j++;
	}

	ans=minn(ans,tans);
}

cout<<ans<<endl;

}

int main()
{

int t;
cin>>t;
while(t--)
solve();

}


#include<iostream>
#include<vector>
using namespace std;

int main() {
	int tc;
	cin >> tc;
	while(tc--) {
		int n, k;
		cin >> n >> k;
		vector<int> C(n);
		bool allEqual = true;
		for (int i = 0; i < n; i++) {
			cin >> C[i];
			if (i > 0 && C[i] != C[i - 1]) {
				allEqual = false;
			}
		}
		if (allEqual) {
			cout << "0\n";
			continue;
		}
		int res = 1e9;
		for (int i = 1; i <= 100; i++) {
			vector<int> v;
			for (int j = 0; j < n; j++) {
				if (C[j] != i) v.push_back(j);
			}
			int ans = 0;
			int l = 0;
			for (int j = 0; j < (int) v.size(); j++) {
				while(l < (int) v.size() && v[l] - v[j] + 1 <= k) {
					l++;
				}
				ans++;
				j = (l - 1);
			}
			res = min(res, ans);
		}
		cout << res << "\n";
	}
	return 0;

}