ACM竞赛要组队， 两个新手和一个高手 或 两个高手和一个新手 可以组成一队，问最多可以组成多少对？
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.