Help me in solving CNDY problem

My issue

Give me the solution

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here

}

Problem Link: Candies Practice Coding Problem