#include using namespace std; #define rep(i,n) for (long long i=0;i<(long long)(n);i++) #define all(v) v.begin(),v.end() using ll=long long; using pll=pair; using tll=tuple; const ll INF=(1ll<<60); template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a> t; while(t--){ vector v(3); cin >> v[0] >> v[1] >> v[2]; vector h(3); rep(i,3) h[i]=v[i]; vector n; n.push_back({0,1}); n.push_back({0,2}); n.push_back({1,2}); ll ans=0; do{ ll sum=0; for(auto &[x,y]:n){ ll k=min(v[x],v[y]); v[x]-=k; v[y]-=k; sum+=(x+y)%3*k; } rep(i,3){ if(2<=v[i]){ sum+=(v[i]+v[i])%3*(v[i]/2); } } chmax(ans,sum); rep(i,3) v[i]=h[i]; }while(next_permutation(all(n))); cout << ans << endl; } }