Nested square (2)

Write code for, given a non-negative integer nn, printing a nested square of size nn, as shown in the examples.

The program must implement and use the NESTED-SQUARE function, which must be recursive and is not allowed to perform input/output operations.

Make one submission with Python code and another submission with C++ code.

Input

The input is an integer n0n \geq 0.

Output

The output is a nested square of size nn.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T15:50:24.826Z

© Jutge.org, 2006–2026.
https://jutge.org