This question was asked 4 years ago, back in 2016. The problem was: https://www.codechef.com/DEC16/problems/SEAINCR
I read the solutions of others and understood that