GOODMEAL - Eat a Good Meal
You’re hungry, and you’re about to be executed. You’re planning your last meal, and you want to be sure you maximize your enjoyment. Pizza, for example, provides a 7/10 enjoyment level per slice, but takes up 20% of your available stomach space per slice. Fudge, on the other hand, provides a 9/10 enjoyment level per square and uses only 2% of your available stomach space, but you can only eat 3 squares before you get sick of it.
Given a potential menu by your captors, including the enjoyment level it provides per unit, the stomach space required per unit, and the maximum number of units you can enjoy, plan the perfect final meal.
Input:
First line is an integer, representing the number of different items on the menu.
Each subsequent line is one menu item, formatted as “name spacePerUnit enjoymentPerUnit maxUnits”.
Output:
The maximum amount of enjoyment you can get from the available menu within 100 stomach space, as an integer.
Input | Output |
3 Pizza 20 7 5 Fudge 2 9 3 Soda 5 3 3 |
61 |
4 Burrito 10 4 10 Apple 5 5 2 Pie 5 8 2 Cookies 2 4 4 |
70 |
4 Steak 20 8 1 Potato 10 4 2 Vegetables 10 1 10 Sundae 15 6 2 |
31 |
hide comments
:D:
2012-10-17 17:46:48
Re: Francky.
|
|
Andres R. Arrieche S. [UCLA-ve]:
2012-10-17 15:36:57
@Ashish it is just one test case |
|
Ashish:
2012-10-17 13:52:17
How do I know if input has finished? |
|
Aman Gupta:
2012-10-17 11:36:04
Why are all the new problems without constraints? |
|
Francky:
2012-10-17 11:35:45
WA** BANK isn't yet a very similar problem ???
|
Added by: | Ben Dilts |
Date: | 2012-10-12 |
Time limit: | 0.400s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |