Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started