codeforces Shovels and Swords

Shovels and Swords
纯数学
#include
using namespace std;
int main()
{
int t,n,m;
scanf("%d",&t);
while(t–)
{
scanf("%d%d",&n,&m);
if(m>n) swap(n,m);
if(n>=m*2) printf("%d\n",m);
else printf("%d\n",(m+n)/3);
}
return 0;
}

你可能感兴趣的:(codeforces Shovels and Swords)