Editorial for DMOPC '23 Contest 1 P2 - Knights on Chessboard

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: yzhao123

There are many solutions to this problem. The intended solution will be described here.

Notice that placing a full row of knights covers five rows: itself, and the two rows above and below it. Thus, starting from the third row, and every five rows, we place a full row of knights. To fit within the bound of knights, casework is required for handling N = 1 \pmod 5 and N = 2 \pmod 5.


  • -14
    volcano  commented on Dec. 6, 2023, 1:40 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.