| Codeforces Round 1039 (Div. 2) |
|---|
| Finished |
In the recycling center, there are $$$n$$$ trash bags, the $$$i$$$-th bag has a weight of $$$a_i$$$. At each second, two actions will happen successively:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$c$$$ ($$$1 \leq n \leq 30$$$, $$$1 \leq c \leq 10^9)$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq 10^9$$$) — the weight of each trash bag.
For each test case, you must output a single integer — the minimum number of coins you have to spend to destroy all trash bags.
45 1010 4 15 1 83 421000000000 1000000000 100000000010 3029 25 2 12 15 42 14 6 16 910 10000001 1 1 1 1 1 1 1 1 864026633
2 3 6 1
In the following explanation:
In the first test case, one solution is:
In total, you paid $$$2$$$ coins, and we can prove it is optimal.
In the second test case, one solution is:
| Name |
|---|


