#include #include #include using namespace std; int main() { int arr[4][4] = { {2, 4, 6, 8}, {10, 12, 14, 16}, {18, 19, 20, 22}, {24, 26, 28, 30} }; int n; cout << "Enter the number of additional numbers: "; cin >> n; vector numbers; for (int i = 0; i < 16; i++) { numbers.push_back(arr[i / 4][i % 4]); } cout << "Enter " << n << " numbers: "; for (int i = 0; i < n; i++) { int num; cin >> num; numbers.push_back(num); } // Sort in descending order sort(numbers.rbegin(), numbers.rend()); // Take the top 16 numbers and store them in a new 4x4 array int newArr[4][4]; for (int i = 0; i < 16; i++) { newArr[i / 4][i % 4] = numbers[i]; } // Output the new array cout << "New 4x4 array: " << endl; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { cout << newArr[i][j] << " "; } cout << endl; } return 0; }