ACMT - Acm Teams
xieyikai2333 · · 题解
一道简单的数学题
- 题目传送门
- 为了方便描述,我们把高手和新手中人数较多的称作
A 类人,人数较少的称作B 类人。
这题可以分两种情况考虑:
第一种:如果
第二种:否则,只要合理分配,就可以每
AC 代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t,x,y;
cin>>t;
while(t--)
{
cin>>x>>y;
if(max(x,y)>2*min(x,y))cout<<min(x,y)<<endl;
else cout<<(x+y)/3<<endl;
}
return 0;
}
附上 AC记录