#include #include #include using namespace std; int main() { int n, m; // Read first array size and elements cin >> n; vector arr1(n); for (int i = 0; i < n; i++) { cin >> arr1[i]; } // Read second array size and elements cin >> m; vector arr2(m); for (int i = 0; i < m; i++) { cin >> arr2[i]; } // Merge both arrays into one vector vector merged; merged.insert(merged.end(), arr1.begin(), arr1.end()); merged.insert(merged.end(), arr2.begin(), arr2.end()); // Sort the merged array sort(merged.begin(), merged.end()); // Output the sorted array for (int num : merged) { cout << num << " "; } cout << endl; return 0; }