Chess board (4)

Write code for, given a non-negative integer n, where n = 2^(k) for some
k ≥ 1, printing a chess board of size n, as shown in the examples.

The program must implement and use the CHESS-BOARD function, which can
be iterative or 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 n of the form n = 2^(k) for some k ≥ 1.

Output

The output is a chess board of size n.

Observation

The size n of a chess board is always of the form n = 2^(k) for some
k ≥ 1.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T16:02:14.812Z

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