stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

#include <vector>

#include <algorithm>

#include <string>

#include <set>

#include <map>

#include <list>

#include <time.h>

#include <math.h>

#include <random>

#include <deque>

#include <queue>

#include <cassert>

#include <unordered_map>

#include <unordered_set>

#include <iomanip>

#include <bitset>

#include <sstream>

#include <chrono>

#include <cstring>

#include<bits/stdc++.h>



using namespace std;



typedef long long ll;

typedef double db;



#define ft first

#define sd second

#define flag bool fl=true



#define mod 1000003

#define N 100001

#define MX 1000000001

#define MXX 1000000000000000001



#define pb push_back

#define For(i, a, b) for(int i=a;i<=b;i++)

#define T int t, qq=0; cin>>t; while(qq++<t)

#define fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define scarr(array, size) for(int i=0;i<size;i++) cin>>array[i]



#define deg(rad) (rad*180.0)/pi

#define pi acos(-1)

#define log(n) (int)log2(n)

#define logg(a)(b) log(b)/log(a)





/*

//----------useful_functions----------



long long extended_euclid(ll a, ll b, ll &x, ll &y){//ax+by=c

    if(b==0)

    {

        x=1, y=0;

        return a;

    }



    ll x1, y1;

    ll d=extended_euclid(b, a%b, x1, y1);

    x=y1;

    y=x1-y1*(a/b);

    return d;

}

long long bigMod(ll a, ll b){//(a^b)%mod

    ll ans=1;

    while(b)

    {

        if(b%2==1) ans=(ans*a)%mod;

        a=(a*a)%mod;

        b/=2;

    }

    return ans%mod;

}

long long modInverse(ll a, ll b){//a*x=1 mod b

    ll x, y;

    ll gcd=extended_euclid(a, b, x, y);



    if(gcd==1) return ((x%b)+b)%b;

    else return 1;

}

long long nCr(ll n, ll r){//n<=1e6

    //declare globally-> ll fact[1000001];

    fact[1]=1;

    for(ll i=2;i<1000001;i++)

        fact[i]=(i*fact[i-1])%mod;



    return (fact[n]*modInverse(fact[r], mod)*modInverse(fact[n-r], mod))%mod;

}

long long josephus(ll n, ll k){//k'th person is killed out of n in the circle

    if(n==1) return 1;

    else return (josephus(n-1, k)+k-1)%n+1;

}

vector<int> sieve(ll n){//get primes up to n<=1e6 and the numbers can be handled up to 1e12

    bool fl[n+1];

    vector<int> primes;

    for(int i=0;i<=n;i++) fl[i]=false;



    for(int i=3;i*i<=n;i+=2)

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

            fl[j]=true;



    primes.pb(2);

    for(int i=3;i<=n;i+=2) if(!fl[i]) primes.pb(i);

    return primes;

}



*/



int main()

{

    int n,ans=0;

    cin>>n;



    int a[n], b[n];

    for(int i=0;i<n;i++) cin>>a[i];

    for(int i=0;i<n;i++) cin>>b[i];



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

        ans+=max(0, a[i]-b[i]);

    cout<<ans;



//        cout<<"Case "<<qq<<": ";

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//#pragma GCC         optimize("O3")

#include            <bits/stdc++.h>

#include            <ext/pb_ds/assoc_container.hpp>

#include            <ext/pb_ds/tree_policy.hpp>

#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define pb          push_back

#define mp          make_pair

#define mem(x,i)    memset(x,i,sizeof(x))

#define ff          first

#define ss          second

#define popcount(x) __builtin_popcount(x)

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

#define Case(t)     for(int ks=1;ks<=t;ks++)

#define fileout     freopen("output.txt","w",stdout)

#define filein      freopen("input.txt","r",stdin)

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

#define endl        '\n'



using namespace std;

using namespace __gnu_pbds;



using ll  = long long;

using ld  = long double;

using ull = unsigned long long;

using pii = pair<int,int>;

using pll = pair<ll,ll>;

using pil = pair<int,ll>;



const int INF    = 0x3f3f3f3f;

const ll LL_INF  = 0x3f3f3f3f3f3f3f3f;

const double PI  = acos(-1);

const double eps = 1e-4;

const int mod    = 1e9+7;

const int mx     = 5e5+5;

template <typename T>  using orderedSet =

    tree<T, null_type, less_equal<T>,

    rb_tree_tag, tree_order_statistics_node_update>;//find_by_order,order_of_key*/



/*------------------------------Graph Moves----------------------------*/

//const int fx[]= {+1,-1,+0,+0};

//const int fy[]= {+0,+0,+1,-1};

//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move

//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move

//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move

//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

/*---------------------------------------------------------------------*/



//ll powmod(ll a,ll b){ll res=1;a%=mod;assert(b>=0);for(; b; b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

/*----------------------BitMask-----------------------------------------*/

//inline int setBit(int N,int pos){return N=N | (1<<pos);}

//inline int resetBit(int N,int pos){return N= N & ~(1<<pos);}

//inline bool checkBit(int N,int pos){return (bool) (N& (1<<pos));}



int main()

{

    int n;

    cin>>n;

    int a[n],b[n];

    for(int i=0;i<n;i++) cin>>a[i];

    for(int i=0;i<n;i++) cin>>b[i];

    int ans=0;

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

    {

        ans+=max(0,a[i]-b[i]);

    }

    cout<<ans<<endl;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define REP(i,x) for(int i=0;i<(int)(x);i++)

#define REPS(i,x) for(int i=1;i<=(int)(x);i++)

#define mp(a,b) make_pair(a, b)

#define pb push_back

#define eb emplace_back

#define ll long long

int main() {

    int N;

    cin>>N;

    int ar[N];

    int ar2[N];

    REP(i,N)

    {

        cin>>ar[i];

    }

    REP(i,N)

    {

        cin>>ar2[i];

    }int c=0;

    REP(i,N)

    {

        if(ar[i]>ar2[i])

        c+=ar[i]-ar2[i];

    }

    cout<<c<<endl;

}

    

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ll long long

#define inf 1e18

#define gap " "

#define pi 2 * acos (0.0)



int main()

{

    

    int n;

    cin>> n;

    int a[n],b[n];

    int s=0;

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

        cin>> a[i];

    }

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

        cin>> b[i];

    }

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

        if ((a[i]-b[i])>0) s=s+(a[i]-b[i]);

    }

    cout << s <<endl;



}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long int

using namespace std;



int main(void)

{

	ll n,s=0;

	cin>>n;

	ll c[n],v[n];

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

	{

		cin>>c[i];

	}

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

	{

		cin>>v[i];

	}

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

	{

		if(c[i]-v[i]>0)

		{

			s+=(c[i]-v[i]);

		}

	}

	cout<<s<<endl;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



const int N = 22;



int main() {

    int n;

    array<int, N> v, c;



    cin >> n;

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

        cin >> v[i];

    }

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

        cin >> c[i];

    }



    int ans = INT_MIN;

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

        int cur_v = 0, cur_c = 0;

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

            if (i & (1 << j)) {

                cur_v += v[j];

                cur_c += c[j];

            }

        }

        ans = max(ans, cur_v - cur_c);

    }



    cout << ans << endl;

}




// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include<cmath>

#include<cstring>

#define pb              push_back

#define pi              acos(-1.0)

#define loop(i,a,n)     for(int i=a;i<n;i++)

#define rloop(i,n,a)    for(int i=n;i>=a;i--)

#define ll              long long int

#define ff              first

#define ss              second

#define pii             pair<ll,ll>

#define sc1(a)          scanf("%d",&a)

#define sc2(a,b)        scanf("%d %d",&a,&b)

#define sc3(a,b,c)      scanf("%d %d %d",&a,&b,&c)

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

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

#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define fileout         freopen("output.txt","w",stdout)

#define filein          freopen("input.txt","r",stdin)

#define inf             2e9+5

#define Q               int q;cin>>q;while(q--)

#define check           cout<<"HI"<<endl;



//int x[]= {-1,0,0,1};

//int y[]= {0,-1,1,0};



using namespace std;



int main()

{

        int n,m=0;

        cin >> n;



        int a[n+5];

        int b[n+5];



        loop(i,0,n)cin>> a[i];

        loop(i,0,n)cin>> b[i];



        loop(i,0,n) if((a[i]-b[i])>0)m+=a[i]-b[i];

        cout<<m<<endl;

    }


























// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

    cin>>n;

    vector<int>v(n+2),c(n+2),d(n+2);

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

    {

        cin>>v[i];

    }

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

    {

        cin>>c[i];

    }

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

    {

        d[i]=v[i]-c[i];

    }

    long long ans=0;

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

    {

        if(d[i]>0)

            ans+=d[i];

    }

    cout<<ans<<endl;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int V[40];

int C[40];



int main()

{

	int n,x,i,j,y,z;

	cin>>n;

	int ans = 0;

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

		cin>>V[i];

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

		cin>>C[i];

	

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



		ans += max(0,V[i]-C[i]);

	}

	cout<<ans;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <algorithm>

#include <climits>

#include <cmath>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <set>

#include <sstream>

#include <string>

#include <vector>



#define endl '\n'

#define ull unsigned long long

#define ll long long

#define ul unsigned long

#define ld long double

#define PI 3.14159265359



using namespace std;



int main() {

	ios_base::sync_with_stdio(false);

	cin.tie(nullptr);

	cout.tie(nullptr);

	int t = 1;

	// cin >> t;

	while (t--) {

		int n;

		cin >> n;

		vector<int> v(n), c(n);

		for (auto &i : v) {

			cin >> i;

		}

		for (auto &i : c) {

			cin >> i;

		}

		int m = INT_MIN;

		int s = 0;

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

			if (v[i] > c[i])

				s += v[i] - c[i];

			m = max(m, s);

		}

		cout << m;

	}

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<bits/stdc++.h>



using namespace std;



int main()

{

    int n,sum=0,i;

    cin >> n;

    int arr1[n];

    int arr2[n];

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

        cin >> arr1[i];

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

        cin >> arr2[i];

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

    {

        if(arr1[i]>arr2[i])

        {

            sum+=arr1[i]-arr2[i];

        }

    }

    cout << sum;



}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main ()

{

    int n, p=0;

    scanf ("%d", &n);

    int v[n], c[n];

    for (int i=0;i<n;i++) scanf ("%d", &v[i]);

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

        scanf ("%d", &c[j]);

        if (c[j]<=v[j]) p=p+v[j]-c[j];

    }

    if (p>0) printf ("%d", p);

    else printf ("0");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <math.h>

using namespace std;



int main()

{

    int a,c,w;

    c=0;

    w=0;

    cin >> a;

    if(a>=111 && a<=999)

    {





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

        {



            if(a%10==9)

                w=1;



            if(a%10==1)

                w=9;



            c=c+w*pow(10,i);

            a=a/10;

        }

        cout << c;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string s;

    while(cin>>s)

    {

        string ss="";

        for(int i=0;i<s.size();i++)

        {

            if(s[i]=='9')

            {

               ss+="1";

            }

            else

            {

                ss+="9";

            }



        }

        cout<<ss<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main(void)

{

	ios::sync_with_stdio(false);

	cin.tie(nullptr);

	cout.tie(nullptr);



	int n;

	cin >> n;



	cout << 1110 - n << endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<string>

using namespace std;

int m, n, a[10], a_2[10], ID[100001];

int dp[100001][10];

int table[] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9};



int rec( int now, int sum ){

  if(now == n + 1) return sum % 10 == 0;

  if(~dp[now][sum % 10]) return dp[now][sum % 10];



  int ret = 0;

  if(~ID[now]){

    ret += rec( now + 1, sum + ID[now]);

  }else{

    if(now & 1)

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

        ret += rec( now + 1, sum + a[i]);

      }

    else

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

        ret += rec( now + 1, sum + a_2[i]);

      }

  }

  return dp[now][sum % 10] = ret;

}



int main(){

  fill_n( *dp, 100001 * 10, -1);

  cin >> n;

  for(int i = n ; i ; i-- ){

    char c;

    cin >> c;

    if(c == '*') ID[i] = -1;

    else ID[i] = i % 2 ? c - '0' : table[c - '0'];

  }

  cin >> m;

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

    cin >> a[i];

    a_2[i] = table[a[i]];

  }

  cout << rec( 1, 0) << endl;

}

// Optimized solution to the same problem (faster):
#include<iostream>

#include<algorithm>

#include<string>

using namespace std;

int m, n, a[10], a_2[10], ID[100001];

int table[] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9};



int main(){

  cin >> n;

  for(int i = n ; i ; i-- ){

    char c;

    cin >> c;

    if(c == '*') ID[i] = -1;

    else ID[i] = i % 2 ? c - '0' : table[c - '0'];

  }

  cin >> m;

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

    cin >> a[i];

    a_2[i] = table[a[i]];

  }



  int dp[2][10] = {{}};

  dp[0][0] = 1;

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

    for(int j = 0 ; j < 10 ; j++ ){

      dp[i & 1][j] = 0;

    }

    if(~ID[i]) {

      for(int j = 0 ; j < 10 ; j++ ){

        dp[i & 1][( j + ID[i] ) % 10] += dp[(i - 1) & 1][j];

      }

    } else {

      for(int k = 0 ; k < m ; k++ ){

        int next = (i % 2 ? a[k] : a_2[k]);

        for(int j = 0 ; j < 10 ; j++ ){

          dp[i & 1][( j + next ) % 10] += dp[(i - 1) & 1][j];

        }

      }

    }

  }

  cout << dp[n & 1][0] << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int n;

vector<int> vec;



int main(int argc, char *argv[])

{

    cin >> n;

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

    {

        int num;

        cin >> num;

        vec.emplace_back(num);

    }

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

    ++n;

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

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

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

  {

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

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

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<vector>



using namespace std;



int main()

{

    int n;

    cin>>n;

    int A[1000000];

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

        cin>>A[i];

    sort(A,A+n);

    if(A[n/2] == A[n/2-1])

    {

        cout<<0;

        return 0;

    }

    else

    {

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

        return 0;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

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

  {

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

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

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n;

int qus[1000005];

int beg,las,midd;

int big,sma;

int fro,tai,ans;

bool ups(int x,int y){

	return x<y;

}

int main(){

	cin>>n;

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

		cin>>qus[i];

	}

	sort(qus,qus+n,ups);

	if(qus[n/2]==qus[n/2-1]){

		cout<<"0"<<endl;

	}

	else cout<<qus[n/2]-qus[n/2-1];

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

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

  {

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

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

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main() {

	int n;

	cin >> n;

	vector<int> a(n);

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

	{

		cin >> a[i];

	}

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

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

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

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

  {

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

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

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cstdio>

#include<stdlib.h>

using namespace std; 

int a[100000];

int cmp(const void *a,const void *b)

{

	return *(int *)a - *(int *)b;

}

int main(void)

{

	int n;

	scanf("%d",&n);

	int i;

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

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

	//sort(a,a+n);

	qsort(a,n,sizeof(a[0]),cmp);

	printf("%d",a[n/2] - a[n/2-1]);

	return 0;	

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

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

  {

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

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

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int MAX_n=1e5;

int n;

int d[MAX_n+10];

bool comp(int a,int b)

{

    return a<b;

}

int main()

{

    cin>>n;

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

    {

        cin>>d[i];

    }

    sort(d+1,d+n+1,comp);

    if(d[n/2]==d[n/2+1])

    {

        cout<<"0";

        return 0;

    }

    cout<<d[n/2+1]-d[n/2];

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{

	int n,i,b,a[100005];

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

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

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

	 sort(a,a+n);

	 printf("%d\n",a[n/2]-a[n/2-1]);

	}

}

// Fastest known solution for this problem: