#P5951. Winning an Auction

    ID: 4820 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2016ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学)

Winning an Auction

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.

3 1 1 2 2 4 2 3 3 3
Alice 0 Bob 1 Alice 1 Bob 1 Alice 2 Bob 1