{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou have three piles of candies: red, green and blue candies:\u003c/p\u003e\u003cul\u003e \u003cli\u003e the first pile contains only red candies and there are $$$r$$$ candies in it, \u003c/li\u003e\u003cli\u003e the second pile contains only green candies and there are $$$g$$$ candies in it, \u003c/li\u003e\u003cli\u003e the third pile contains only blue candies and there are $$$b$$$ candies in it. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEach day Tanya eats exactly two candies of different colors. She is free to choose the colors of eaten candies: the only restriction that she can\u0027t eat two candies of the same color in a day.\u003c/p\u003e\u003cp\u003eFind the maximal number of days Tanya can eat candies? Each day she needs to eat \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly\u003c/span\u003e two candies.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains integer $$$t$$$ ($$$1 \\le t \\le 1000$$$) — the number of test cases in the input. Then $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eEach test case is given as a separate line of the input. It contains three integers $$$r$$$, $$$g$$$ and $$$b$$$ ($$$1 \\le r, g, b \\le 10^8$$$) — the number of red, green and blue candies, respectively.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint $$$t$$$ integers: the $$$i$$$-th printed integer is the answer on the $$$i$$$-th test case in the input.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\n1 1 1\n1 2 1\n4 1 1\n7 4 10\n8 1 4\n8 2 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n2\n2\n10\n5\n9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example, Tanya can eat candies for one day only. She can eat any pair of candies this day because all of them have different colors.\u003c/p\u003e\u003cp\u003eIn the second example, Tanya can eat candies for two days. For example, she can eat red and green candies on the first day, and green and blue candies on the second day.\u003c/p\u003e\u003cp\u003eIn the third example, Tanya can eat candies for two days. For example, she can eat red and green candies on the first day, and red and blue candies on the second day. Note, that two red candies will remain uneaten.\u003c/p\u003e"}}]}