ZeptoLab Code Rush 2015 C题Om Nom and Candies

A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with the same task if you were on his place?

One day, when he came to his friend Evan, Om Nom didn’t find him at home but he found two bags with candies. The first was full of blue candies and the second bag was full of red candies. Om Nom knows that each red candy weighsWrgrams and each blue candy weighsWbgrams. Eating a single red candy gives Om NomHrjoy units and eating a single blue candy gives Om NomHbjoy units.

Candies are the most important thing in the world, but on the other hand overeating is not good. Om Nom knows if he eats more thanCgrams of candies, he will get sick. Om Nom thinks that it isn’t proper to leave candy leftovers, so he can only eat a whole candy. Om Nom is a great mathematician and he quickly determined how many candies of what type he should eat in order to get the maximum number of joy units. Can you repeat his achievement? You can assume that each bag contains more candies that Om Nom can eat.

,爱情唯美短句子

ZeptoLab Code Rush 2015 C题Om Nom and Candies

相关文章:

你感兴趣的文章:

标签云: