fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  4. #define int long long
  5. #define endl '\n'
  6.  
  7. void solve(){
  8. int r,g,b;
  9. cin>>r>>g>>b;
  10. int ans=0;
  11. int lim = min({(int)2, r, g, b});
  12. for(int k=0;k<=lim;++k) ans = max(ans, k + (r-k)/3 + (g-k)/3 + (b-k)/3);
  13. cout<<ans<<endl;
  14. }
  15.  
  16. int32_t main(){
  17. fast_io;
  18. int t=1;
  19. if(cin>>t){
  20. while(t--) solve();
  21. } else solve();
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5316KB
stdin
3 5 5
stdout
2
2
2