Question: For each test cases, k is given. k is the number of ingredients. Following k , there are k lines. Each line has 3 numbers.
For each test cases, k is given. k is the number of ingredients.
Following k there are k lines. Each line has numbers. They represent protein, fat and carbohydrate content in the kth ingredient.
Following these k lines, lines are given. Each line has numbers. They represent protein, fat and carbohydrate. For these targets, we need to find out the ingredients to be added to exactly match the target.
Output: for the lines in each test case, print space separated numbers denoting the ingredients to be added to get the exact match.
The ingredients must be printed in the sorted order. If there are many combinations, print the one which minimum number of ingredients.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
