osu! is a globally popular rhythm game with four modes: osu!, osu!taiko, osu!catch, and osu!mania. osu!mania is a falling-note rhythm game, similar to a piano simulator. This mode was primarily developed and ported by woc2006. It is based on various lane-based rhythm games (such as Dance Dance Revolution and Beatmania).
Each game of osu!mania consists of a number of notes. During gameplay, every hit on a note results in a judgment: MAX, 300, 200, 100, 50, or MISS (0). Let $a, b, c, d, e, f$ be the number of notes for which the player received these judgments, respectively. The accuracy (Acc) of the game can be calculated as follows:
$$\text{Acc} = \frac{300a + 300b + 200c + 100d + 50e + 0f}{300(a + b + c + d + e + f)} \times 100\%$$
Since the accuracy may be an infinite decimal, the game displays the rounded result. Specifically, the accuracy for each game is rounded to two decimal places in percentage form, i.e., with a precision of $10^{-4}$.
In addition to accuracy, there is another important metric for measuring performance on a single song in osu!mania: Personal Performance (pp). Personal performance is related to the star rating of the beatmap and the judgment results. The star rating determines the maximum pp that can be obtained on the beatmap, denoted as $\text{ppmax}$. The personal performance obtained by a player in a game can be calculated as follows (the meanings of $a, b, c, d, e, f$ are the same as in the Acc calculation):
$$\text{pp} = \max \left( 0, \frac{320a + 300b + 200c + 100d + 50e + 0f}{320(a + b + c + d + e + f)} - 80\% \right) \times 5 \times \text{ppmax}$$
The personal performance for each game is rounded to the nearest integer.
Given the maximum pp ($\text{ppmax}$) of a beatmap and the player's judgment results $a, b, c, d, e, f$ for a game on that beatmap, calculate the player's accuracy and personal performance.
Input
The input is read from standard input. This problem contains multiple test cases. The first line contains a positive integer $T$, representing the number of test cases. It is guaranteed that $1 \le T \le 100$. For each test case: The first line contains a non-negative integer $\text{ppmax}$. It is guaranteed that $0 \le \text{ppmax} \le 3000$. The second line contains six non-negative integers $a, b, c, d, e, f$, with meanings as described in the problem statement. It is guaranteed that $0 \le a, b, c, d, e, f \le 2 \times 10^4$ and $a + b + c + d + e + f \ge 1$.
Output
Output to standard output. For each test case, output a single line containing two values separated by a space. The first value is the accuracy, output as a percentage with a precision of $10^{-4}$; the second value is the personal performance, output as an integer.
Examples
Input 1
2 630 3029 2336 377 41 10 61 3000 20000 10000 0 0 0 0
Output 1
96.20% 423 100.00% 2688
Note
In the second test case of the example, the accuracy is $100\%$, and the personal performance is:
$$\text{pp} = \max \left( 0, \frac{320 \times 20000 + 300 \times 10000}{320 \times (20000 + 10000)} - 80\% \right) \times 5 \times 3000 = 2687.5 \approx 2688$$