https://www.codechef.com/CDMN21A/problems/SHADES

https://www.codechef.com/CDMN21A/problems/SHADES
Can somebody explain this problem