Home STD Contest Notification Clarification Problems Ranklist Status Print Sign Out

Winning an Auction

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 20    Accepted Submission(s): 2


Problem Description
Alice and Bob play an auction game. Alice has A dollars and Bob has B dollars initially. There are N items on sale. In each round, an item will be sold by the following way. Alice writes down an integer a (0 ¡Ü a ¡Ü A) and Bob writes down an integer b (0 ¡Ü b ¡Ü B), which are the amount of dollars they want to pay for the item. If a > b, then Alice gets the item and pays a dollars to the seller. If a < b, then Bob gets the item and pays b dollars to the seller. If a = b, then for the 1st, 3rd, 5th, 7th ... round, Alice gets the item and pays a dollars; for the 2rd, 4th, 6th, 8th ... round, Bob gets the item and pays b dollars. Since all the items have the same value, the goal of the auction game is to get as many items as possible. Both Alice and Bob know the values of N,A and B. Your task is to calculate how many items they will get if both of them play optimally.
 

Input
The first line is the number of test cases. Each test case contains 3 integers N,A and B, which are no larger than 255.
 

Output
For each test case, output the number of items Alice and Bob will get if both of them play optimally.
 

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

Sample Output
Alice 0 Bob 1 Alice 1 Bob 1 Alice 2 Bob 1
 

Statistic | Submit | Clarifications | Back