This problem is from spoj.com and is called 'Candy I'
link to the problem: http://www.spoj.com/problems/CANDY/
This is a rather basic problem which just uses some primitive math and logic.
Please subscribe to the channel if you like what we do, it gives us the inspiritment and helps us make more videos for you.
Cheers.