stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
/*

 Shahadat Hossain

 I.C.T Department

 Comilla University

 Session: 2013-2014

 */



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef unsigned long long ull;



#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))

#define UNIQUE(x)       x.erase(unique(all(x)), x.end())



#define fs              first

#define sc              second

#define pb              push_back



#define sz(x)           (int)x.size()

#define all(v)          v.begin(),v.end()

#define D(x)            cerr << #x " = " << x << '\n'

#define ms(a,b)         memset(a, b, sizeof(a))

#define valid(x,y,n, m)      x>=0 && y>=0 && x<n && y<m



#define input           freopen("/Users/shahadat/Desktop/input.txt", "r", stdin)

#define output          freopen("/Users/shahadat/Desktop/output.txt", "w", stdout)



#define endl            '\n'

#define eps             1e-5

#define yes             printf("Yes\n")

#define no              printf("No\n")



#define int             long long



inline void fast(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

}



//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

//uniform_int_distribution<int>(10, 20)(rng);



int gcd(int n,int m){return m==0?n:gcd(m,n%m);}

inline int Set(int n,int pos) { return n = n | (1LL << pos); }

inline int Reset(int n,int pos) { return n = n & ~(1LL << pos); }

inline bool Check(int n,int pos) { return (bool)(n & (1LL << pos)); }

inline int Count(ll n) { return __builtin_popcountll(n); }



typedef pair<int,int> pint;



//int const INF = 1e9 + 10;

//int const MOD = 1e9 + 7;



int const N = 1e6;

int ar[N];



int32_t main(){

    int n;

    cin >> n;

    

    for(int i = 1; i <= n; i++){

        cin >> ar[i];

    }

    sort(ar + 1, ar + n + 1);

    

    int mid = n / 2;

    int res = ar[mid + 1] - ar[mid];

    cout << res << endl;

}








// Faster C++ solution for the same problem (measured speedup: 5.194604917200608x):
#include<stdio.h>

#include<map>

#include<vector>

#include<map>

#include<algorithm>

using namespace std;

int p[200008];

int main(){

  int n;

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

    scanf("%d",p+i);

  sort(p+1,p+n+1);

  int x=n/2;

  x=p[x+1]-p[x];

 // x--;

  printf("%d\n",x);

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main() {

	int N,count=0;

	cin >> N;

	vector<int> v(N);

	for (int i = 0; i < N; i++)

		cin >> v[i];

	sort(v.begin(), v.end());

	for (int i = v[(v.size() / 2) - 1]; i < v[(v.size() / 2)]; i++)

	{

		count++;

	}

	cout << count;

	system("pause");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.263335021034519x):
#include<stdio.h>

#include<map>

#include<vector>

#include<map>

#include<algorithm>

using namespace std;

int p[200008];

int main(){

  int n;

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

    scanf("%d",p+i);

  sort(p+1,p+n+1);

  int x=n/2;

  x=p[x+1]-p[x];

 // x--;

  printf("%d\n",x);

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

using namespace std;

int d[1000000];

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>d[i];

	}

	sort(d,d+n);

	cout<<(d[n/2]-d[n/2-1]);

}

// Faster C++ solution for the same problem (measured speedup: 5.182573315158254x):
#include <stdio.h>

#include <algorithm>

using namespace std;

int a[100005];

int main()

{

	int n,m,i,j,k,s,t;

	while(~scanf("%d",&n))

	{

		for(i=1;i<=n;i++)

		scanf("%d",&a[i]);

	    sort(a+1,a+1+n);

	    m=n/2;

	    printf("%d\n",a[m+1]-a[m]);

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

#define vstroku() to_string()

#define vchislo() to_ulong()

#define gcd(x,y) __builtin_gcd(x,y)

#define numberof1(x) __builtin_popcount(x)

#define povsemelementam(i,mnozh) for(auto i: mnozh)

#define podotrezok(i,j) substr(i-1,j) // like prefix sum, (i,j)=s[j]-s[i-1]

#define pb push_back

#define pf push_front

#define popf pop_front

#define popb pop_back 

#define pii pair <int, int>

#define F first

#define S second

#define mipletsplay ios_base::sync_with_stdio(0); cin.tie(0); 





using namespace std;

const ll INFLL = 1e18;

const int MAXN = 3e5;

const ll INF = 1e9;

const ll kek=998244353;



int main() {

mipletsplay;

int n;

cin>>n;

vector <int> a(n);

for (int i=0;i<n;i++)

cin>>a[i];

sort(a.begin(),a.end());

int f=n/2;

int cnt=0;



if (a[f]==a[f-1])

{

    cout<<0;

    return 0;

    

}

else

{

cnt=a[f]-a[f-1];

cout<<cnt;

}}


// Faster C++ solution for the same problem (measured speedup: 5.2550993623628965x):
#include <stdio.h>

#include <algorithm>

using namespace std;

int a[100005];

int main()

{

	int n,m,i,j,k,s,t;

	while(~scanf("%d",&n))

	{

		for(i=1;i<=n;i++)

		scanf("%d",&a[i]);

	    sort(a+1,a+1+n);

	    m=n/2;

	    printf("%d\n",a[m+1]-a[m]);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>





using namespace std;



int compare(const void * x1, const void * x2)   // функция сравнения элементов массива

{

	return (*(int*)x1 - *(int*)x2);              // если результат вычитания равен 0, то числа равны, < 0: x1 < x2; > 0: x1 > x2

}



int main() {

	int n;

	cin >> n;

	vector<int> D(n);

	for (int i = 0; i < n; i++)

		cin >> D.at(i);

	sort(D.begin(), D.end());

	cout << D[n / 2] - D[n / 2 - 1];

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.1965943792613585x):
#include <stdio.h>

#include <algorithm>

using namespace std;

int a[100005];

int main()

{

	int n,m,i,j,k,s,t;

	while(~scanf("%d",&n))

	{

		for(i=1;i<=n;i++)

		scanf("%d",&a[i]);

	    sort(a+1,a+1+n);

	    m=n/2;

	    printf("%d\n",a[m+1]-a[m]);

	}

	return 0;

}
// Slower C++ solution:
/*

 Shahadat Hossain

 I.C.T Department

 Comilla University

 Session: 2013-2014

 */



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef unsigned long long ull;



#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))

#define UNIQUE(x)       x.erase(unique(all(x)), x.end())



#define fs              first

#define sc              second

#define pb              push_back



#define sz(x)           (int)x.size()

#define all(v)          v.begin(),v.end()

#define D(x)            cerr << #x " = " << x << '\n'

#define ms(a,b)         memset(a, b, sizeof(a))

#define valid(x,y,n, m)      x>=0 && y>=0 && x<n && y<m



#define input           freopen("/Users/shahadat/Desktop/input.txt", "r", stdin)

#define output          freopen("/Users/shahadat/Desktop/output.txt", "w", stdout)



#define endl            '\n'

#define eps             1e-5

#define yes             printf("Yes\n")

#define no              printf("No\n")



#define int             long long



inline void fast(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

}



//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

//uniform_int_distribution<int>(10, 20)(rng);



int gcd(int n,int m){return m==0?n:gcd(m,n%m);}

inline int Set(int n,int pos) { return n = n | (1LL << pos); }

inline int Reset(int n,int pos) { return n = n & ~(1LL << pos); }

inline bool Check(int n,int pos) { return (bool)(n & (1LL << pos)); }

inline int Count(ll n) { return __builtin_popcountll(n); }



typedef pair<int,int> pint;



//int const INF = 1e9 + 10;

//int const MOD = 1e9 + 7;



int const N = 1e6;

int ar[N];



int32_t main(){

    int n;

    cin >> n;

    

    for(int i = 1; i <= n; i++){

        cin >> ar[i];

    }

    sort(ar + 1, ar + n + 1);

    

    int mid = n / 2;

    int res = ar[mid + 1] - ar[mid];

    cout << res << endl;

}








// Faster C++ solution for the same problem (measured speedup: 5.18496836829735x):
#include <stdio.h>

#include <algorithm>

using namespace std;

int a[100005];

int main()

{

	int n,m,i,j,k,s,t;

	while(~scanf("%d",&n))

	{

		for(i=1;i<=n;i++)

		scanf("%d",&a[i]);

	    sort(a+1,a+1+n);

	    m=n/2;

	    printf("%d\n",a[m+1]-a[m]);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main() {

	int N,count=0;

	cin >> N;

	vector<int> v(N);

	for (int i = 0; i < N; i++)

		cin >> v[i];

	sort(v.begin(), v.end());

	for (int i = v[(v.size() / 2) - 1]; i < v[(v.size() / 2)]; i++)

	{

		count++;

	}

	cout << count;

	system("pause");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.253570970421838x):
#include <stdio.h>

#include <algorithm>

using namespace std;

int a[100005];

int main()

{

	int n,m,i,j,k,s,t;

	while(~scanf("%d",&n))

	{

		for(i=1;i<=n;i++)

		scanf("%d",&a[i]);

	    sort(a+1,a+1+n);

	    m=n/2;

	    printf("%d\n",a[m+1]-a[m]);

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

using namespace std;

int d[1000000];

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>d[i];

	}

	sort(d,d+n);

	cout<<(d[n/2]-d[n/2-1]);

}

// Faster C++ solution for the same problem (measured speedup: 4.984381673798805x):
#include<stdio.h>

#include<algorithm>

#include<queue>

#include<string.h>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int z[100005];

		int ans=0;

		for(int i=1;i<=n;i++)

		scanf("%d",&z[i]);

		sort(z,z+n+1);

		ans=(z[n/2+1]-z[n/2]);

		printf("%d\n",ans);

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

#define vstroku() to_string()

#define vchislo() to_ulong()

#define gcd(x,y) __builtin_gcd(x,y)

#define numberof1(x) __builtin_popcount(x)

#define povsemelementam(i,mnozh) for(auto i: mnozh)

#define podotrezok(i,j) substr(i-1,j) // like prefix sum, (i,j)=s[j]-s[i-1]

#define pb push_back

#define pf push_front

#define popf pop_front

#define popb pop_back 

#define pii pair <int, int>

#define F first

#define S second

#define mipletsplay ios_base::sync_with_stdio(0); cin.tie(0); 





using namespace std;

const ll INFLL = 1e18;

const int MAXN = 3e5;

const ll INF = 1e9;

const ll kek=998244353;



int main() {

mipletsplay;

int n;

cin>>n;

vector <int> a(n);

for (int i=0;i<n;i++)

cin>>a[i];

sort(a.begin(),a.end());

int f=n/2;

int cnt=0;



if (a[f]==a[f-1])

{

    cout<<0;

    return 0;

    

}

else

{

cnt=a[f]-a[f-1];

cout<<cnt;

}}


// Faster C++ solution for the same problem (measured speedup: 5.054134184487378x):
#include<stdio.h>

#include<algorithm>

#include<queue>

#include<string.h>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int z[100005];

		int ans=0;

		for(int i=1;i<=n;i++)

		scanf("%d",&z[i]);

		sort(z,z+n+1);

		ans=(z[n/2+1]-z[n/2]);

		printf("%d\n",ans);

	}

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>





using namespace std;



int compare(const void * x1, const void * x2)   // функция сравнения элементов массива

{

	return (*(int*)x1 - *(int*)x2);              // если результат вычитания равен 0, то числа равны, < 0: x1 < x2; > 0: x1 > x2

}



int main() {

	int n;

	cin >> n;

	vector<int> D(n);

	for (int i = 0; i < n; i++)

		cin >> D.at(i);

	sort(D.begin(), D.end());

	cout << D[n / 2] - D[n / 2 - 1];

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.997866545254124x):
#include<stdio.h>

#include<algorithm>

#include<queue>

#include<string.h>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int z[100005];

		int ans=0;

		for(int i=1;i<=n;i++)

		scanf("%d",&z[i]);

		sort(z,z+n+1);

		ans=(z[n/2+1]-z[n/2]);

		printf("%d\n",ans);

	}

}
// Slower C++ solution:
/*

 Shahadat Hossain

 I.C.T Department

 Comilla University

 Session: 2013-2014

 */



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef unsigned long long ull;



#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))

#define UNIQUE(x)       x.erase(unique(all(x)), x.end())



#define fs              first

#define sc              second

#define pb              push_back



#define sz(x)           (int)x.size()

#define all(v)          v.begin(),v.end()

#define D(x)            cerr << #x " = " << x << '\n'

#define ms(a,b)         memset(a, b, sizeof(a))

#define valid(x,y,n, m)      x>=0 && y>=0 && x<n && y<m



#define input           freopen("/Users/shahadat/Desktop/input.txt", "r", stdin)

#define output          freopen("/Users/shahadat/Desktop/output.txt", "w", stdout)



#define endl            '\n'

#define eps             1e-5

#define yes             printf("Yes\n")

#define no              printf("No\n")



#define int             long long



inline void fast(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

}



//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

//uniform_int_distribution<int>(10, 20)(rng);



int gcd(int n,int m){return m==0?n:gcd(m,n%m);}

inline int Set(int n,int pos) { return n = n | (1LL << pos); }

inline int Reset(int n,int pos) { return n = n & ~(1LL << pos); }

inline bool Check(int n,int pos) { return (bool)(n & (1LL << pos)); }

inline int Count(ll n) { return __builtin_popcountll(n); }



typedef pair<int,int> pint;



//int const INF = 1e9 + 10;

//int const MOD = 1e9 + 7;



int const N = 1e6;

int ar[N];



int32_t main(){

    int n;

    cin >> n;

    

    for(int i = 1; i <= n; i++){

        cin >> ar[i];

    }

    sort(ar + 1, ar + n + 1);

    

    int mid = n / 2;

    int res = ar[mid + 1] - ar[mid];

    cout << res << endl;

}








// Faster C++ solution for the same problem (measured speedup: 4.986685135467041x):
#include<stdio.h>

#include<algorithm>

#include<queue>

#include<string.h>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int z[100005];

		int ans=0;

		for(int i=1;i<=n;i++)

		scanf("%d",&z[i]);

		sort(z,z+n+1);

		ans=(z[n/2+1]-z[n/2]);

		printf("%d\n",ans);

	}

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main() {

	int N,count=0;

	cin >> N;

	vector<int> v(N);

	for (int i = 0; i < N; i++)

		cin >> v[i];

	sort(v.begin(), v.end());

	for (int i = v[(v.size() / 2) - 1]; i < v[(v.size() / 2)]; i++)

	{

		count++;

	}

	cout << count;

	system("pause");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.052664241214388x):
#include<stdio.h>

#include<algorithm>

#include<queue>

#include<string.h>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int z[100005];

		int ans=0;

		for(int i=1;i<=n;i++)

		scanf("%d",&z[i]);

		sort(z,z+n+1);

		ans=(z[n/2+1]-z[n/2]);

		printf("%d\n",ans);

	}

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

using namespace std;

int d[1000000];

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>d[i];

	}

	sort(d,d+n);

	cout<<(d[n/2]-d[n/2-1]);

}

// Faster C++ solution for the same problem (measured speedup: 4.811615764304322x):
#include<stdio.h>

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;

int main()

{

	int a, b, c, d, e, f, g, h, i, p;

	int z[100005];

	scanf("%d", &a);

	for (i = 0; i < a; i++)scanf("%d", &z[i]);

	sort(z, z + a);

	b = z[a / 2-1 ]; c = z[a / 2];

	printf("%d\n", c - b);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

#define vstroku() to_string()

#define vchislo() to_ulong()

#define gcd(x,y) __builtin_gcd(x,y)

#define numberof1(x) __builtin_popcount(x)

#define povsemelementam(i,mnozh) for(auto i: mnozh)

#define podotrezok(i,j) substr(i-1,j) // like prefix sum, (i,j)=s[j]-s[i-1]

#define pb push_back

#define pf push_front

#define popf pop_front

#define popb pop_back 

#define pii pair <int, int>

#define F first

#define S second

#define mipletsplay ios_base::sync_with_stdio(0); cin.tie(0); 





using namespace std;

const ll INFLL = 1e18;

const int MAXN = 3e5;

const ll INF = 1e9;

const ll kek=998244353;



int main() {

mipletsplay;

int n;

cin>>n;

vector <int> a(n);

for (int i=0;i<n;i++)

cin>>a[i];

sort(a.begin(),a.end());

int f=n/2;

int cnt=0;



if (a[f]==a[f-1])

{

    cout<<0;

    return 0;

    

}

else

{

cnt=a[f]-a[f-1];

cout<<cnt;

}}


// Faster C++ solution for the same problem (measured speedup: 4.878950551644785x):
#include<stdio.h>

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;

int main()

{

	int a, b, c, d, e, f, g, h, i, p;

	int z[100005];

	scanf("%d", &a);

	for (i = 0; i < a; i++)scanf("%d", &z[i]);

	sort(z, z + a);

	b = z[a / 2-1 ]; c = z[a / 2];

	printf("%d\n", c - b);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>





using namespace std;



int compare(const void * x1, const void * x2)   // функция сравнения элементов массива

{

	return (*(int*)x1 - *(int*)x2);              // если результат вычитания равен 0, то числа равны, < 0: x1 < x2; > 0: x1 > x2

}



int main() {

	int n;

	cin >> n;

	vector<int> D(n);

	for (int i = 0; i < n; i++)

		cin >> D.at(i);

	sort(D.begin(), D.end());

	cout << D[n / 2] - D[n / 2 - 1];

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.824633230525881x):
#include<stdio.h>

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;

int main()

{

	int a, b, c, d, e, f, g, h, i, p;

	int z[100005];

	scanf("%d", &a);

	for (i = 0; i < a; i++)scanf("%d", &z[i]);

	sort(z, z + a);

	b = z[a / 2-1 ]; c = z[a / 2];

	printf("%d\n", c - b);

	return 0;

}
// Slower C++ solution:
/*

 Shahadat Hossain

 I.C.T Department

 Comilla University

 Session: 2013-2014

 */



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef unsigned long long ull;



#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))

#define UNIQUE(x)       x.erase(unique(all(x)), x.end())



#define fs              first

#define sc              second

#define pb              push_back



#define sz(x)           (int)x.size()

#define all(v)          v.begin(),v.end()

#define D(x)            cerr << #x " = " << x << '\n'

#define ms(a,b)         memset(a, b, sizeof(a))

#define valid(x,y,n, m)      x>=0 && y>=0 && x<n && y<m



#define input           freopen("/Users/shahadat/Desktop/input.txt", "r", stdin)

#define output          freopen("/Users/shahadat/Desktop/output.txt", "w", stdout)



#define endl            '\n'

#define eps             1e-5

#define yes             printf("Yes\n")

#define no              printf("No\n")



#define int             long long



inline void fast(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

}



//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

//uniform_int_distribution<int>(10, 20)(rng);



int gcd(int n,int m){return m==0?n:gcd(m,n%m);}

inline int Set(int n,int pos) { return n = n | (1LL << pos); }

inline int Reset(int n,int pos) { return n = n & ~(1LL << pos); }

inline bool Check(int n,int pos) { return (bool)(n & (1LL << pos)); }

inline int Count(ll n) { return __builtin_popcountll(n); }



typedef pair<int,int> pint;



//int const INF = 1e9 + 10;

//int const MOD = 1e9 + 7;



int const N = 1e6;

int ar[N];



int32_t main(){

    int n;

    cin >> n;

    

    for(int i = 1; i <= n; i++){

        cin >> ar[i];

    }

    sort(ar + 1, ar + n + 1);

    

    int mid = n / 2;

    int res = ar[mid + 1] - ar[mid];

    cout << res << endl;

}








// Faster C++ solution for the same problem (measured speedup: 4.813839384644958x):
#include<stdio.h>

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;

int main()

{

	int a, b, c, d, e, f, g, h, i, p;

	int z[100005];

	scanf("%d", &a);

	for (i = 0; i < a; i++)scanf("%d", &z[i]);

	sort(z, z + a);

	b = z[a / 2-1 ]; c = z[a / 2];

	printf("%d\n", c - b);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main() {

	int N,count=0;

	cin >> N;

	vector<int> v(N);

	for (int i = 0; i < N; i++)

		cin >> v[i];

	sort(v.begin(), v.end());

	for (int i = v[(v.size() / 2) - 1]; i < v[(v.size() / 2)]; i++)

	{

		count++;

	}

	cout << count;

	system("pause");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.877531558740985x):
#include<stdio.h>

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;

int main()

{

	int a, b, c, d, e, f, g, h, i, p;

	int z[100005];

	scanf("%d", &a);

	for (i = 0; i < a; i++)scanf("%d", &z[i]);

	sort(z, z + a);

	b = z[a / 2-1 ]; c = z[a / 2];

	printf("%d\n", c - b);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin >> n;

    vector<int>v(n);

    for(int i=0;i<n;i++) {

        cin >> v[i];

    }

    sort(v.begin() , v.end());

    int r = v[n-1];

    int cnt=0;

    for(int i=1;i<=r;i++){

    int x = lower_bound(v.begin(),v.end(),i)-v.begin();

     int rs = n-x;

     int ls = n-rs;

     if(rs == ls){

         cnt++;

     }

    }

     cout << cnt << '\n';

    

}

// Faster C++ solution for the same problem (measured speedup: 1.3089667237921394x):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin >> n;

    vector<int>v(n);

    for(int i=0;i<n;i++) {

        cin >> v[i];

    }

    sort(v.begin() , v.end());

    cout << v[n/2] - v[n/2 -1]<<endl;

    

}
// Slower C++ solution:
#include<iostream>

#include<string>

#include<map>

#include<vector>

#include<algorithm>

using namespace std;



int main(){

  int N, K = 0; cin >>N;

  vector<int> ds(N);

  for(int& d : ds){ cin >>d; }

  sort(ds.begin(), ds.end());

  for(int k = ds[0]; k <= ds[N - 1]; k++){

    int i = lower_bound(ds.begin(), ds.end(), k) - ds.begin();

    if(N / 2 == i) K++;

  }

  cout <<K <<endl;

  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.285355660609595x):
#include<iostream>

#include<string>

#include<map>

#include<vector>

#include<algorithm>

using namespace std;



int main(){

  int N; cin >>N;

  vector<int> ds(N);

  for(int& d : ds) cin >>d;

  sort(ds.begin(), ds.end());

  cout <<ds[N / 2] - ds[N / 2 - 1] <<endl;

  return 0;

}