logo AlgoBeat OnlineJudge
登录 注册

#215792. [JAG 2024 Summer Camp #2] Give Me a Lot of Triangles

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You have sticks of length , sticks of length , and sticks of length . You can perform the following operation any number of times:

  • Choose 3 sticks such that they can form a triangle. Use these 3 sticks to make a triangle. Once used, these sticks cannot be used to form other triangles.

To "form a triangle", the lengths of the chosen sticks , , and must satisfy the triangle inequality: , , and .

Determine the maximum number of triangles that can be made.

Given test cases, compute the answer for each.

输入格式

The input is given in the following format:

Here, denotes the -th test case.

Each test case is given in the following format:

  • All input values are integers.

输出格式

Output lines. On the -th line, output the answer for the -th test case.

样例

样例输入 1

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

样例输出 1

2
1
0
41730095