To help you prepare for your final exams, the university gives you a limited number of study days. Because study time is scarce, you must divide it wisely among your courses to maximize your GPA.
Each course offers several grades, and each grade requires a minimum number of study hours. Spending more hours on a course can raise its grade. Sometimes it is worth accepting a low grade in one demanding course so that you can secure high grades in several other courses.
Given the number of study hours available and, for every course, how many hours are needed to earn each possible grade, compute the maximum GPA you can achieve.
Your GPA is the average of the grade points of your $n$ courses:
$$\text{GPA} = \frac{1}{n}\sum_{i=1}^{n} p_i$$
where $p_i$ is the grade point earned in course $i$.
The first line contains an integer $K \ge 1$, the number of data sets. Each data set has the following form:
| Grade | A | A- | B+ | B | B- | C+ | C | C- | D+ | D |
|---|---|---|---|---|---|---|---|---|---|---|
| Points | 4.0 | 3.7 | 3.3 | 3.0 | 2.7 | 2.3 | 2.0 | 1.7 | 1.3 | 1.0 |
The 10 integers on each line are non-increasing (earning an A requires the most hours). If you study at least the listed number of hours for a grade, you earn that grade; you always receive the best grade you can afford. If you do not study enough even for a D, the course grade is F, worth 0.0 points.
For each data set, first print Data Set x: on its own line, where $x$ is the data set number (starting from 1). Then print the maximum GPA obtainable by distributing your $H$ study hours among the courses, rounded to two decimal places (round half up).