| Insomnia 2025 |
|---|
| Finished |
You are given an array $$$a$$$ of size $$$n$$$. You can perform the following operation any number of times (including zero):
The score of the array is defined as the sum of all its elements, plus the total cost of the operations performed.
Your task is to determine the minimum possible score that can be achieved after performing any number of operations.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each testcase contains a single integer $$$n$$$ ($$$1\le n\le 10^5$$$) — the size of the array $$$a$$$.
The second line contains $$$n$$$ integers $$$a_1$$$,$$$a_2$$$,…,$$$a_n$$$ ($$$1\le a_i\le 10^9$$$) — the elements of array $$$a$$$.
The sum of $$$n$$$ over all testcases does not exceed $$$10^6$$$.
Output a single integer for each test case - the minimum possible score after applying the operations any number of times (including zero).
231 1 152 3 3 2 3
3 13
| Name |
|---|


