Can anyone explain solution of this?
https://www.codechef.com/submit-v2/PENS
AMA: TheOneYouWant
Atcoder ABC #351 Short Solution Discussion