Problems
Alice and Bob both have a sweet tooth, and they are going to play a game to
collect pancakes. There are
In subsequent turns, each of them must choose an unclaimed stack that is adjacent
to a stack they claimed themselves before. That is, for Alice to claim stack
The game ends when every stack is claimed. At that point, Alice collects all pancakes from all stacks she claimed, and Bob collects all pancakes in all stacks he claimed.
Alice wants to get as many pancakes as possible for herself, and Bob wants to get as many pancakes as possible for himself. Can you help Alice find out the maximum number of pancakes she can collect if they both play optimally?
Input
The first line of the input gives the number of test cases,
The first line of each test case contains an integer
The second line contains
The third line contains
Output
For each test case, output one line containing
Case #, where
Example
3
5
30 50 40 20 10
1 2 4 5
5
20 20 80 10 10
1 4 2 5
4
90 10 10 10
1 4 1 4
Case #1: 120
Case #2: 100
Case #3: 90