#K14326. Maximize Alice's Score

    ID: 24110 Type: Default 1000ms 256MiB

Maximize Alice's Score

Maximize Alice's Score

Alice and Bob are playing a game with letters. Each lowercase letter has an alphabetical value: \( a=1, b=2, \ldots, z=26 \). Given a string \( S \), first convert each letter into its corresponding value. Then, sort these values in descending order.

In this game, Alice picks the first value and every alternate value thereafter (i.e. the values at indices \(0, 2, 4, \ldots\) when the values are zero-indexed) to maximize her score. Your task is to compute the maximum score Alice can obtain from the string.

The input starts with an integer \( T \) representing the number of test cases, followed by \( T \) lines where each line contains a string \( S \) of lowercase letters. For each test case, output the maximum score that Alice can achieve.

inputFormat

The first line of input contains a single integer \( T \) denoting the number of test cases. Each of the following \( T \) lines contains a string \( S \) composed only of lowercase English letters.

outputFormat

For each test case, output a single integer on a new line — the maximum score that Alice can obtain.

## sample
2
abc
defg
4

12

</p>