QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓

#10760. 充电

統計

《以撒的结合》(The Binding of Isaac)是一款带有浓厚 Roguelike 元素的随机生成动作 RPG 射击游戏。在游戏中,玩家可以拾取不同的道具,并在使用后产生各种效果,这极大地丰富了游戏性。主动道具是其中的一类特殊道具。每个主动道具在充满电后可以使用一次,因此使用充能条来表示当前的充能进度。为了给主动道具充能,玩家需要清理房间:清理一个小房间可以为充能条增加 1 个单位的能量,而清理一个大房间可以增加 2 个单位的能量。特别地,对于仅剩 1 个单位即可充满的主动道具,清理大房间的效果与清理小房间相同。使用主动道具会清空充能条。

游戏中功能最强大的主动道具“虚空”(Void)拥有 6 个单位的充能条,当前已充能 5 个单位。

现在,水水持有一个充能条大小为 $k$ 个单位的主动道具。初始时,充能条是空的,地图上有 $x$ 个未清理的小房间和 $y$ 个未清理的大房间。水水可以选择以任意顺序清理这些未清理的房间。请计算水水使用该道具的最大次数。

输入格式

输入包含多个测试用例。 第一行包含一个整数 $t$ ($1 \le t \le 2 \times 10^5$),表示测试用例的数量。 每个测试用例仅占一行,包含三个整数 $k, x, y$ ($1 \le k \le 10^9, 0 \le x, y \le 10^9$)。

输出格式

对于每个测试用例,输出一行,包含一个整数,表示答案。

样例

输入 1

3
6 6 6
9 6 2
3 1 4

输出 1

3
1
2

游戏中功能最强大的主动道具“虚空”(Void)拥有 6 个单位的充能条,当前已充能 5 个单位。

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.