QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100

#14374. 赢得拍卖

Estadísticas

Alice 和 Bob 在玩一个拍卖游戏。起初,Alice 有 $A$ 元,Bob 有 $B$ 元。有 $N$ 件物品待售。在每一轮中,将按以下方式售出一件物品:Alice 写下一个整数 $a$($0 \le a \le A$),Bob 写下一个整数 $b$($0 \le b \le B$),这分别代表他们愿意为该物品支付的金额。如果 $a > b$,则 Alice 获得该物品并向卖家支付 $a$ 元;如果 $a < b$,则 Bob 获得该物品并向卖家支付 $b$ 元;如果 $a=b$,则在第 1, 3, 5, 7... 轮中,Alice 获得该物品并支付 $a$ 元;在第 2, 4, 6, 8... 轮中,Bob 获得该物品并支付 $b$ 元。由于所有物品的价值相同,拍卖游戏的目标是获得尽可能多的物品。Alice 和 Bob 都知道 $N$、$A$ 和 $B$ 的值。你的任务是计算如果两人都采取最优策略,他们各自能获得多少件物品。

输入格式

第一行是测试用例的数量。每个测试用例包含 3 个整数 $N$、$A$ 和 $B$,它们均不超过 255。

输出格式

对于每个测试用例,输出如果两人都采取最优策略,Alice 和 Bob 各自将获得的物品数量。

样例

输入样例 1

3
1 1 2
2 4 2
3 3 3

输出样例 1

Alice 0 Bob 1
Alice 1 Bob 1
Alice 2 Bob 1

Discussions

About Discussions

The discussion section is only for posting: 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.
  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.