Problem

Source: 2019 CWMI P3

Tags: rectangle, combinatorics



Let $S=\{(i,j) \vert i,j=1,2,\ldots ,100\}$ be a set consisting of points on the coordinate plane. Each element of $S$ is colored one of four given colors. A subset $T$ of $S$ is called colorful if $T$ consists of exactly $4$ points with distinct colors, which are the vertices of a rectangle whose sides are parallel to the coordinate axes. Find the maximum possible number of colorful subsets $S$ can have, among all legitimate coloring patters.