TORONTO KIDS COMPUTER CLUB | Aurora Saturday 14:30 Python Practice 22.07.16.
20845
post-template-default,single,single-post,postid-20845,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Aurora Saturday 14:30 Python Practice 22.07.16.

21 Jul Aurora Saturday 14:30 Python Practice 22.07.16.

Question: 

A knight tried to cross a valley covered by toxic fog. Fortunately, the knight prepared medicinal potions in advance. He only need to make the right the concentration in different proportions.
We that the knight carries n kinds of potions with n different concentrations, the volume V is the same, and the concentration is Pi%. And know that in response to the toxic fog situation in the valley at that time, you only need to select some or all of the potions, and then make a potion with a concentration of no more than W% to detoxify.
How to configure this medicine to get the largest volume of the currently available antidote?
Special note: Due to the limitations of the equipment in the valley, only one kind of existing medicine is allowed to be mixed into another (that is, it is not possible to take a part of one medicine).

Input
The first line of input data is an integer C, indicating the number of groups of test data;
each group of test data contains 2 lines, the first line gives three positive integers n,V,W(1<=n,V,W<= 100); The next line is n integers, representing the concentration of n potions Pi% (1<=Pi<=100).

Output
For each set of test data, please output an integer and a floating point number; where the integer represents the maximum volume of the antidote, and the floating number represents the concentration of the antidote (rounded to the nearest 2 decimal places);
if the antidote that meets the requirements cannot be prepared, Please output 0 0.00.

Sample Input
3
1 100 10
100
2 100 24
20 30
3 100 24
20 20 30

Sample Output
0 0.00
100 0.20
300 0.23

No Comments

Sorry, the comment form is closed at this time.