Candies

Lucia's mother told her to eat no more than 10 candies per day.

Also, if in one day she eat more than 7 candies, in the next two days she can't eat more than 5 candies in these two days.

What is the largest number of candies that Lúcia can eat over a period of 29 consecutive days, following the request of his mother?


The answer is 206.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

She can eat 7 candies each for the first 28 days (specified that MORE than 7 candies triggers the condition) and 10 candies on the last day.

The maximum, would then be 196 + 10 = 206.

Jimmy PrevailLone
Aug 26, 2014

I will divide calculation into two parts: The first 27 days and last 2 days.

In the first 27 days, there are some combinations that might max out candies she can eat. Divide 27 days into 9 groups of 3 days.

  1. Eat 10 in the first day following by 5 in next 2 days. The result is 10 + 5 + 5 = 20

  2. Eat 7 all 3 days.

The result is 7 + 7 + 7 = 21 The second way is better so we choose it. And we have 9 groups so we multipy it by 9: 21 x 9 = 189

The last 2 days problem can be arranged the following to max out.

  1. Eat 10 and then eat 5.

  2. Eat 7 both days

  3. Eat 7 and then eat 10.

Since when we eat 10 is the last day, we don't care the restriction because it couldn't be applied further in these range of days.

The last two days is maxed out by 7 + 10 = 17

Combine those two parts: 189 + 17 = 206 is the answer.

did it the same way.....Cheers!!!

Vighnesh Raut - 6 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...