|
|||
Bankrupt BakerWolfgang Puck has an extensive collection of cake recipes. They are separated into different binders depending on the type of cake. Although Wolfgang has restaurant franchises all over the world, he is in a period of hard times and is struggling to afford ingredients for his cakes. What cakes can he create with his small budget?
Input SpecificationOn the first line, you are given t (1 ≤ t ≤ 100), the number of binders. Each binder begins with title, the name of the binder, then the next line contains m, n, and b (1 ≤ m, n ≤ 100, 1 ≤ b ≤ 106), where b is Wolfgang's budget in dollars. The next m lines are given as “ingredient c” (see sample input), where c (0 ≤ c ≤ 5000) is the price in dollars for one unit of ingredient. Then follow n recipes. Each recipe begins with name on a line of its own, then the very next line contains k (1 ≤ k ≤ 100). The following k lines are of the form “requirement x” (see sample input), where x is the number of units of the ingredient requirement used in the recipe name. Output SpecificationFor each binder, output the name of the binder in uppercase letters, then on separate lines a list of recipes within Wolfgang's budget in increasing order of cost. If no such recipe exists, print “Too expensive!”. If recipes have the same cost, print them in lexicographical order. Print a blank line after each binder. Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |