问题 H: Alice and Bob

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

Given an sequence of n elements a1,a2, ...... ,an.

Alice and Bob will play a game alternating turns with Alice going first.

If the current sequence length is n, select a position pos (1pos<n) to divide the sequence into two part. If the sum of all elements from the first position to the pos position is less than the sum of all elements from thepos+1 position to the last position, then delete the first element to thepos element. Otherwise, delete the pos+1 element to the n element.

When the sequence length after a person's operation is 11, that person wins.

Alice and Bob both want to win. If they can, they hope the element in the final sequence bigger. Otherwise, they hope the element in the final sequence smaller.

Find the answer if both Alice and Bob play optimally.

输入格式

Each test contains multiple test cases. The first line contains the number of test cases TT1000). The description of the test cases follows.

The first line contains one integer n1<n3000).

The second line contains n integers a1, a2,, an1 ai109).

It's guaranteed that n10000

输出格式

For each test case, first print "Alice" or "Bob" means who will win, then print an integer means the final sequence.

输入样例 复制

3
3
1 2 3
4
1 2 3 4
5
1 2 3 4 5

输出样例 复制

Bob 2
Alice 3
Alice 4