Answered step by step
Verified Expert Solution
Link Copied!

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 3 numbers. They represent protein, fat and carbohydrate content in the kth ingredient.
Following these k lines, 3 lines are given. Each line has 3 numbers. They represent protein, fat and carbohydrate. For these 3 targets, we need to find out the ingredients to be added to exactly match the target.
Output: for the 3 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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions