
as per given condition, (i, k), (j, k), (j, l) are of distinct colour. No two square of kth row will be of same colour as (i, k) and (j, k) are of distinct colour and no two squares of ith column of same colour as (j, l) and (j, k) are of distinct colour.
⇒ all squares of type (x, 1) for x = 1, 2, 3, … n are of distinct colour ⇒ total n distinct colours.
Similarly all square of type (n, y) for y = 1, 2, …. n are of distinct colour, also no squares of (x, 1) & (n, y) with same colour otherwise take square (n, n) with (x, 1) and (n, y); we get contradiction to given condition.
There will be atleast 2n – 1 colours. Now let us prove 2n – 1 colours are sufficient
We can see that (x, y) & (x + 1, y – 1) can have same colours. So paint all squares with same colours for which x + y is same.
Here minimum x + y will be 2(for x = 1, y = 1) & maximum x + y = 2n
As from 2 to 2n there 2n – 1 values, So 2n – 1 colours will be sufficient.