#include #include using namespace std; int main() { const int nrows {20}; const int ncols {30}; cout << "P3\n" << ncols << " " << nrows << "\n" << "255\n"; for (int row {0}; row < nrows; ++row) { for (int col {0}; col < ncols; ++col){ if (row < nrows / 2 && col < ncols / 2) { cout << "220 20 60\n"; } else if (row < nrows / 2 && col >= ncols / 2) { cout << "0 87 183\n"; } else if (row >= nrows / 2 && col < ncols / 2) { cout << "255 215 0\n"; } else { cout << "0 155 72\n"; } } } return EXIT_SUCCESS; }