Problem

Source: Kyiv mathematical festival 2017

Tags: Kyiv mathematical festival, combinatorics



Each cell of a $7\times7$ table is painted with one of several colours. It is known that for any two distinct rows the numbers of colours used to paint them are distinct and for any two distinct columns the numbers of colours used to paint them are distinct.What is the maximum possible number of colours in the table?