#include using namespace std; int f(int a,int b,int c){ if(a<1||b<1||c<1){ return 1e9; } if(a==b&&b==c){ return f(a-1,b,c-2)+3; } if(a==b){ if(ac){ return f(a,b-1,c)+1; } else{ return f(a,b,c-1)+1; } } if(a==c){ if(a> t; for(int i=0;i> a >> b >> c; if(f(a,b,c)>=1e9){ cout << -1 << endl; } else{ cout << f(a,b,c) << endl; } } }