**Input** : Given T test cases.

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.

**Sample input/output:**

1 //testcases

5 3 // 5 ingredients 3 targets

1 2 3 //1st ingredient

4 5 6 //2nd β¦

7 8 9

9 18 12

5 7 9 //5th ingredient

5 7 9 //1st target

11 13 15 //2nd target

52 14 3 // 3rd target

Expected output:

5

2 3

-1

Note: -1, when no combination(s) found

Here i have solved it by using Merge Sort and get all possible combinations.

https://paste.ubuntu.com/p/BFrmN3KNkc/

Is there any other way to solve this problem?