F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Alice and Bob

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 304    Accepted Submission(s): 96


Problem Description
Given an sequence of $n$ elements $a_1,$ $a_2,$ $...$ , $a_n$.

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

If the current sequence length is $n $, select a position $pos $ ($1\le pos < 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 the $pos+1$ position to the last position, then delete the first element to the $pos$ element. Otherwise, delete the $pos+1$ element to the $n$ element.

When the sequence length after a person's operation is $1 $, 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.
 

Input
Each test contains multiple test cases. The first line contains the number of test cases $T$($ T\le 1000 $).
The description of the test cases follows.

The first line contains one integer $n$($1 < n \le 3000 $).

The second line contains $n$ integers $a_1, \ a_2, \dots , \ a_n$( $ 1 \le \ a_i \le 10^9 $).

It's guaranteed that $\sum{n} \le 10000$
 

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

Sample Input
3 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5
 

Sample Output
Bob 2 Alice 3 Alice 4
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 23:35:21, Gzip enabled