SHARE
TWEET

A 593

a guest Oct 17th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int t,q,w,e,x,x1,z,re1,re2;
  6.     scanf("%d",&t);
  7.     while(t--){
  8.         scanf("%d %d %d",&q,&w,&e);
  9.         x=min(w/2,q);
  10.         x1=w-2*x;
  11.         z=min(e/2,x1);
  12.         re1=x+2*x+z+2*z;
  13.         x=min(e/2,w);
  14.         x1=w-x;
  15.         z=min(x1/2,q);
  16.         re2=x+2*x+z+2*z;
  17.         printf("%d\n",max(re1,re2));
  18.     }
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top