Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, a, m, x;
- bool dziala;
- bitset <201> s;
- vector<int> v;
- int main()
- {
- cin >> n;
- for (int j = 1; j <= n; j++)
- {
- s.reset();
- v.clear();
- dziala = 0;
- cin >> m;
- for (int i = 1; i <= m; i++)
- {
- cin >> a;
- s[a] = true;
- v.push_back(a);
- x = a + 1;
- while (x < m * 2)
- {
- if (s[x] == 1)
- x++;
- else
- {
- s[x] = true;
- v.push_back(x);
- break;
- }
- }
- if (x > m * 2)
- {
- cout << -1;
- dziala = 1;
- break;
- }
- }
- if (dziala == 0)
- {
- for (int i = 0; i < v.size(); i++)
- cout << v[i] << " ";
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement