subject

Acme Super Store is having a contest to give away shopping sprees to lucky families. If a family wins a shopping spree each person in the family can take any items in the store that he or she can carry out, however, each person can only take one of each type of item. For example, one family member can take one television, one watch, and one toaster, while another family member can take one television, one camera, and one pair of shoes. Each item has a price (in dollars) and a weight (in pounds) and each person in the family has a limit in the total weight they can carry. Two people cannot work together to carry an item.
Your job is to help the families select items for each person to carry to maximize the total price of all items the family takes. Write an algorithm to determine the maximum total price of items for each family and the items that each family member should select.
Implement your algorithm by writing a program named shopping that follows the specifications below:

Input:
The input file named "shopping. txt" consists of T test cases
T(1 <= T <= 100) is given on the first line of the input file.
Each test case begins with a line containing a single integer number N that indicates the number of items (1 <= N <= 100) in that test case.
Followed by N lines, each containing two integers: P and W. The first integer (1 <= P <= 5000) corresponds to the price of the object and the second integer (1 <= W <= 100) corresponds to the weight of the object.
The next line contains one integer (1 <= F <= 100) which is the number of people in that family.
The next F lines contains the maximum weight (1 <= M <= 200) that can be carried by the i^th person in the family (1 <= i <= F).

Output:
Written to a filed named "shopping. out". For each test case your program should output the maximum total price of all goods that the family can carry out during their shopping spree and for each family member, numbered 1 <= i <= F, list the item numbers 1 <= N <= 100 that they should select.
shopping. txt
4
2
77 7
66 6
2
5
5
6
32 16
43 12
26 4
50 8
20 3
27 9
4
25
23
21
19
5
1 1
2 1
3 1
2 2
5 5
10
1
2
3
4
5
6
7
8
9
10
10
1 1
4 3
4 3
4 4
5 4
8 6
10 7
9 7
11 8
13 9
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:00
Much has been made of the new web 2.0 phenomenon, including social networking sites and user-created mash-ups. how does web 2.0 change security for the internet? how do secure software development concepts support protecting applications?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Answer these and get 40 points and brainliest
Answers: 1
You know the right answer?
Acme Super Store is having a contest to give away shopping sprees to lucky families. If a family win...
Questions
question
History, 10.07.2019 11:50
question
Mathematics, 10.07.2019 11:50
question
Social Studies, 10.07.2019 11:50
Questions on the website: 13722359