Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,b,c,d=0,e,f,k;
- cin>>k;
- for(int i=0;i<k;i++){
- d=0;
- cin>>a>>b>>c;
- while(c>=2&&b>=1){
- c=c-2;
- b=b-1;
- d=d+3;
- }
- while(b>=2&&a>=1){
- b=b-2;
- a=a-1;
- d=d+3;
- }
- cout<<d<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement