I'm new at competititve programming, and I need your help, can you help me?

Hello everyone I have a doubt in the puppy and sum problem here is the link PPSUM Problem - CodeChef