链接:https://codeforces.com/contest/1263/problem/A
题意:给三种糖每天能吃两种,问能吃多少天;
排个序比较输出即可,设a<=b<=c,若a+b<=c,总天数a+b,否则就总和除2;
code:
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e5+10; ll a[maxn]; void solve() { scanf("%lld%lld%lld",&a[0],&a[1],&a[2]); sort(a,a+3); ll ans=0; if(a[2]>=a[0]+a[1]) ans=a[0]+a[1]; else ans=(a[0]+a[1]+a[2])/2; printf("%lld ",ans); return ; } int main() { int t; cin>>t; while(t--) solve(); //system("pause"); return 0; }