Problem

Source: Own. IMO 2022 Malaysian Training Camp 2

Tags: combinatorics



Let n, k be fixed integers. On a n×n board, label each square 0 or 1 such that in each 2k×2k sub-square of the board, the number of 0's and 1's written are the same. What is the largest possible sum of numbers written on the n×n board?