QOJ.ac

QOJ

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

#14407. 生成三角形

統計

你有 $a_1$ 根长度为 1 的木棒,$a_2$ 根长度为 2 的木棒,以及 $a_3$ 根长度为 3 的木棒。你可以进行任意次以下操作:选择 3 根可以组成非零面积三角形的木棒,并用这 3 根木棒组成一个三角形。一旦使用,这些木棒就不能再用于组成其他三角形。

确定可以制作的三角形的最大数量。给定 $t$ 组测试数据,计算每组数据的答案。

输入格式

输入的第一行包含一个整数 $t$,表示测试数据的组数($1 \le t \le 10^4$)。

接下来的 $t$ 行,每行代表一组测试数据,包含三个整数:$a_1$,$a_2$ 和 $a_3$($0 \le a_i \le 10^8$)。

输出格式

对于每组测试数据,输出一个整数:可以制作的三角形的最大数量。

样例

输入样例 1

4
3 1 2
4 1 1
0 0 0
31415926 535897 93238462

输出样例 1

2
1
0
41730095

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.