rpmodi
walker
2. All prices has not to be presented as 5n+4, because we need at least 5 coins.
3. So, in the case of 40, price of 1..5 candies cannot be 5n+4
.
I still don't get how did u come up with 5n+4?
Let me try to explain it.
Lets say the price of one of the candys is 9 cents
which is of the form 5n+4
for this we need to shel out a 5 cent coin + 4 coins of 1 cent each
But the quesion says we can use only 4 coins !
so we cant use a price of the form 5n+4
The price of each candy is given.
you multiply by 2, 3,4 for tue, wed , thur and so on
AS walker has shown, some proces will be of the form 5n+4,
discard !!
Walker you must be a genius ! I could never come up with this