eolymp
bolt
Try our new interface for solving problems
Problems

Merge the sequences

published at 1/11/24, 4:24:03 pm

include <bits/stdc++.h>

using namespace std;

int main() { iosbase::syncwith_stdio(false); cin.tie(NULL);

int n, n1;
cin >> n;

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

cin >> n1;
a.resize(n + n1);
for (int i = n; i < n + n1; cin >> a[i++]);

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

for (int i : a) cout << i << " ";
cout << endl;

return 0;

}