QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#14374. Winning an Auction

Statistics

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 \le a \le A$) and Bob writes down an integer $b$ ($0 \le b \le 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 2nd, 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.

Example

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
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.