Problem

Source: 42nd International Tournament of Towns, Junior A-Level P5, Spring 2021

Tags: Kyiv Tournament, combinatorics



In the center of each cell of a checkered rectangle $M{}$ there is a point-like light bulb. All the light bulbs are initially switched off. In one turn it is allowed to choose a straight line not intersecting any light bulbs such that on one side of it all the bulbs are switched off, and to switch all of them on. In each turn at least one bulb should be switched on. The task is to switch on all the light bulbs using the largest possible number of turns. What is the maximum number of turns if: $M$ is a square of size $21 \times 21$; $M$ is a rectangle of size $20 \times 21$? Alexandr Shapovalov