Chef and Training
All submissions for this problem are available.Chef is solving problems on 3 competitive programming sites called $p$, $q$ and $r$. Each of sites has $a$, $b$ and $c$ problems respectively. Chef is training for ICPC (International Cook Programmer Contest). Chef has to solve exactly $2$ problems daily. Chef has restriction that he can’t solve two problems from same site, and also can’t solve already solved problems for training. Find the maximum number of days for which chef can solve problems. ###Input: First line of the Input contains a single integer $T$ denoting the number of test cases. Description of test case: First Line Of Each Test Case Contains Three Space-separated Integer $a$,$b$ and $c$. ###Output: For each test case, Print a single line containing one integer - Number of Days. ###Constraints - $1<=T<=1000$ - $1<=a,b,c<=10^9$ Example Input 3 1 1 1 1 2 1 8 1 4 Example Output 1 2 5 ###Explanation Example Case 1: Chef can solve problem for one day only. Chef can solve any pair of problems this day. Example Case 2: Chef can solve problem for two days. Chef can solve two problems from $p$ and $q$ competitive programming sites and second day he can solve from $q$ and $r$ competitive programming sites.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.