Advertisement
hiallaah

dekhen

Oct 17th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int a,b,c,d=0,e,f,k;
  6. cin>>k;
  7. for(int i=0;i<k;i++){
  8. d=0;
  9. cin>>a>>b>>c;
  10. while(c>=2&&b>=1){
  11. c=c-2;
  12. b=b-1;
  13. d=d+3;
  14. }
  15. while(b>=2&&a>=1){
  16. b=b-2;
  17. a=a-1;
  18. d=d+3;
  19. }
  20. cout<<d<<endl;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement