LampsGrid
You have a rectangular table containing a grid of lamps (W rows and L columns). Each lamp is initially either "on" or "off". There is a switch underneath each column, and when the switch is flipped, all the lamps in that column reverse their states ("on" lamps become "off" and vice versa).
A row in the grid is considered lit if all the lamps in that row are "on". You must make exactly K flips. The K flips do not necessarily have to be performed on K distinct switches. Your goal is to have as many lit rows as possible after making those flips.
Input
The first line contains three integers: W, L (1 ≤ L, W ≤ 50) and K (0 ≤ K ≤ 1000). Each of the next W lines contains L characters '0' or '1' and describe the rectangular grid of lamps: the j-th character of the i-th line is '1' (one) if the lamp in row i, column j is initially "on", and '0' (zero) otherwise.
Output
Print the maximal number of rows that can be lit after performing exactly K flips.