Write a C++ program. Explain the code with comments, please.
Write the recursive function RS that draws recursive squares of level n, as shown in the figures below, where at each step 4 half-size squares are placed at each corner. Use the square function below for drawing.
void square(x, y, size); // draws a solid square of given size centered at x, y
void RS(int n);
RS(1)
RS(2)
RS(3)
RS(4)