Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <set>
- #include <cmath>
- #include <map>
- #include <string>
- #include <fstream>
- #include <queue>
- using namespace std;
- typedef long long ll;
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- int tt;
- cin >> tt;
- while (tt--) {
- int n;
- cin >> n;
- vector <int> a(n * 2);
- for (int i = 0; i < n * 2; ++i) {
- cin >> a[i];
- }
- sort(a.begin(), a.end());
- cout << a[n] - a[n - 1] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement