CF1366A Shovels and Swords

题目描述

在 MC 中,一把钻石锹要一个钻石和两个木棍合成,一把钻石剑要两个钻石和一个木棍合成,每把钻石工具都能去与村民交易获得 $1$ 个绿宝石。现在有 $a$ 个木棍和 $b$ 个钻石,最多能换到多少绿宝石?

输入格式

第一行一个整数 $t\ (1\leq t\leq 1000)$,代表数据组数。 接下来 $t$ 行每行两个整数 $a,b\ (0\leq a,b\leq 10^9)$,代表木棍和钻石的数量。

输出格式

$t$ 行,每行一个整数,代表最多能换到绿宝石的数量。 Translated By Karry5307

说明/提示

In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel. In the second test case Polycarp does not have any diamonds, so he cannot craft anything.