ll@t; rep(t){ ll@n,@m,z; if(n/4<=m/2){ z=n/4; }else{ z=m/2; n-=z*4; z+=n/2*2/5; } wt(z*3); }