please can anyone explain the approach for this question?
https://www.codechef.com/ICPCIN19/problems/PENS
CodeChef Starters 132 Solution Discussion