New Year Present Problem

https://www.hackerrank.com/challenges/newyear-present/problem

Pls Can anyone explain solution to this problem

Can not able to understand from editorial

@karangreat234 @vijju123

Please help