Advertisement
pdpd123

Problem 4

Feb 17th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define int long long int
  3. #define endl '\n'
  4. using namespace std;
  5. int a[200007];
  6. main()
  7. {
  8.     ios::sync_with_stdio(0);cin.tie(0);
  9.     int T;cin>>T;
  10.     while(T--){
  11.         int n;cin>>n;
  12.         for(int i=1;i<=2*n;i++)cin>>a[i];
  13.         sort(a+1,a+2*n+1);
  14.         cout<<a[n+1]-a[n]<<endl;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement