Impartial Offerings

아직 제출이 없습니다시간 제한10초메모리 제한1024 MB

문제

Aroha is a big animal lover, so she spends some free time taking care of many of her loved ones' pets. She likes to offer them treats, but wants to do that in an impartial way.

Aroha decided that it was logical for pets of the same size to get the same amount of treats and for larger pets to get strictly more treats than smaller ones. For example, if she has 44 pets with her of sizes 10,20,1010,20,10, and 2525, she could offer 22 treats to each pet of size 101033 treats to the pet of size 2020, and 55 treats to the pet of size 2525. This requires her to buy a total of 2+3+2+5=122+3+2+5=12 treats. However, she can offer treats to all 44 pets and comply with her own rules with a total of just 77 treats by offering 11 each to the pets of size 101022 to the pet of size 2020, and 33 to the pet of size 2525.

Help Aroha plan her next pet day. Given the sizes of all pets that will accompany her, compute the minimum number of treats she needs to buy to be able to offer at least one treat to all pets while complying with her impartiality rules.

입력

The first line of the input gives the number of test cases, TTTT test cases follow. Each test case consists of two lines. The first line of a test case contains a single integer NN, the number of pets in Aroha's next pet day. The second line of a test case contains NN integers S_1,S_2,,S_NS\_1,S\_2,\cdots ,S\_N, representing the sizes of each pet.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is the minimum number of treats she needs to buy to be able to offer at least one treat to all pets while complying with her impartiality rules.

제한

  • 1T1001≤T≤100.
  • 1S_i1001≤S\_i≤100, for all ii.

힌트

Sample Case #1 is the case explained above.

In Sample Case #2, all pets are of the same size, so Aroha must offer them all the same amount of treats. The minimum total is attained by offering each pet a single treat.

In Sample Case #3, both pets are of different size so they need a different amount of treats each. Buying less than 22 treats is not enough to give treats to both pets. Buying 22 treats and making sure both pets get something would force Aroha to give both pets the same amount, despite them having different size. Using 33 treats Aroha can give 11 to the small pet and 22 to the big pet and thus comply with all her rules.