#include #include #include int main() { int arr[3][3] = { {9, 8, 7}, {6, 5, 4}, {3, 2, 1} }; int n; std::cout << "Enter the number of elements to add: "; std::cin >> n; std::vector numbers; std::cout << "Enter " << n << " numbers: "; for (int i = 0; i < n; ++i) { int num; std::cin >> num; numbers.push_back(num); } std::vector combined; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { combined.push_back(arr[i][j]); } } combined.insert(combined.end(), numbers.begin(), numbers.end()); std::sort(combined.begin(), combined.end()); std::cout << "Output:" << std::endl; for (int i = 0; i < combined.size(); i += 2) { std::cout << combined[i] << " "; } std::cout << std::endl; for (int i = 1; i < combined.size(); i += 2) { std::cout << combined[i] << " "; } std::cout << std::endl; return 0; }