[Solution] Minimum Sum CodeChef Solution
Problem
You are given an array of length . You can perform the following operation any number of times (possibly 0 times) :
- Choose two distinct indices and and replace either or with .
Find the minimum possible sum (ie. ) that you can achieve, and output that.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first line of each test case contains an integer - the length of the array .
👇👇👇👇👇
- The second line of each test case contains space-separated integers .
Output Format
For each test case, output on a new line the minimum sum of the array that can be achieved.
Explanation:
Test case : Choose and replace with .
Test case : Choose and replace with .
No comments:
Post a Comment