ACMT - Acm Teams

题意翻译

### 大致题意: ACM竞赛要组队, **两个新手和一个高手** 或 **两个高手和一个新手** 可以组成一队,问最多可以组成多少对? ### 输入: 第一行一个整数$t$表示输入样例组数,接下来$t$行每行为一组输入样例,每行有两个数$E$和$N$分别表示高手和新手的总数。 ### 输出: $t$行,每行一个整数,对应输入每组样例的答案。 ### 数据范围: ~~不知道~~ $1 \leq t \leq 10,0 \leq E,N \leq 10^5$。 ```

题目描述

Engineer ahmed sror one of the best coches, He picks team members by using two ways. First one that the optimal team of three people should consist of one experienced participant and two newbies. Thus, each experienced participant can share the experience with a large number of people. Second one that the optimal team should have two experienced members plus one newbie. Thus, each newbie can gain more knowledge and experience. All the teams during the training session should belong to one of the two ways described above. Furthermore,they agree that the total number of teams should be as much as possible. There are E experienced members and N newbies on the training session.Can you calculate what maximum number of teams can be formed?

输入输出格式

输入格式


The first line of the input contains a single integer corresponding to number of test cases t (1 E and _N_ (0 E, _N_

输出格式


For each test case print a single integer representing the maximum number of teams that can be formed.

输入输出样例

输入样例 #1

2
2 6
4 5

输出样例 #1

2
3