fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin>>t;
  8. while(t--){
  9. int a,b,c;
  10. cin>>a>>b>>c;
  11. int x=c/2;
  12. int y=x*2;
  13. b-=x;
  14. int i=b/2;
  15. int j=i*2;
  16. a-=i;
  17. cout<<x+i+j<<endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 4296KB
stdin
3
3 4 5
1 0 5
5 3 2
stdout
5
-1
4