QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#8227. Circle

الإحصائيات

Xiao De is a teaching assistant at Peking University. Now that the semester has ended, the professor wants Xiao De to calculate the final grades for the students and submit them to the academic office. Based on Xiao De's observations, the process of calculating the final grade can be described as follows:

  1. Suppose there are $n$ items in the course, and the score for each item is a real number rounded to one decimal place. Xiao De denotes the multiset of item scores as $S$.

  2. The professor repeats an operation several times. In each operation, the professor chooses one of the following two options (A or B) until only one score remains in $S$:

    • A. The professor takes a score $x$ from $S$, rounds $x$ to the nearest integer, and puts it back into $S$ as a new score.
    • B. The professor takes two different scores $x$ and $y$ from $S$, and puts $x+y$ back into $S$ as a new score.
  3. The professor takes the only remaining score $x$ in $S$, rounds it to the nearest integer, and submits it to the academic office.

Xiao De is a kind student, and as someone who has been through this, he wants to give the students the highest possible grade. Xiao De wants to know what the maximum grade he can submit to the academic office is, following the rules above. Can you help him?

Input

The input contains multiple test cases.

The first line contains a positive integer $T$, representing the number of test cases.

For each test case, the first line contains a positive integer $n$, representing the number of items in the course.

The next line contains $n$ real numbers $a_i$, each having exactly one digit after the decimal point.

Output

For each test case, output a single integer representing the answer on a new line.

Examples

Input 1

2
2
4.4 5.4
6
0.4 0.3 7.3 2.3 4.3 3.3

Output 1

10
19

Subtasks

For all data: $1 \leq T \leq 10^4, 1 \leq \sum n \leq 10^6$, $0 \leq a_i < 10$.

Subtask ID Data Range Special Property Score
1 $n \leq 5$ None 20
2 $T \leq 100, n \leq 12$ None 15
3 $n \leq 80$ None 17
4 None $a_i$ are all multiples of $0.2$ 21
5 None None 27

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.