Editorial Required for COZIE

Please suggest an approach or editorial for the question Golu and Sweetness COZIE.

Problem link :- https://www.codechef.com/problems/COZIE

Thanks.