QOJ.ac

QOJ

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

#14374. Winning an Auction

统计

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

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.