NumberthonNumberthon

SolveFire POTW

Bronze
combinatorics
6/15/2026
Problems sourced from solvefire.net
Problem
A 7×77\times7 grid is filled with 0's and 1's so that each row and each column contains exactly two 1's. Additionally, no four 1's are the corners of an axis-parallel rectangle. Let NN be the number of such grids. Find the remainder when NN is divided by 1000.
Solution ApproachShow

Step-by-step approach

Each row chooses 2 of 7 columns. The no-rectangle condition means no two rows share the same pair of columns. So the 7 row-pairs are a set of 7 distinct 2-element subsets of {1,…,7}\{1,\ldots,7\} such that any two share at most one element (a combinatorial design). This is a Fano plane-like structure. Count the number of such systems and multiply by the number of ways to assign rows.

Ready for more competition problems?

Practice the full SolveFire course and compete in ranked math battles — free to play.