Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split between Alice and Bob as they want: for example, it is possible that Alice takes the whole pile, and Bob gets nothing from it.

After taking the candies from the piles, if Alice has more candies than Bob, she discards some candies so that the number of candies she has is equal to the number of candies Bob has. Of course, Bob does the same if he has more candies.

Alice and Bob want to have as many candies as possible, and they plan the process of dividing candies accordingly. Please calculate the maximum number of candies Alice can have after this division process (of course, Bob will have the same number of candies).

You have to answer $q$ independent queries.

Let's see the following example: $[1, 3, 4]$. Then Alice can choose the third pile, Bob can take the second pile, and then the only candy from the first pile goes to Bob — then Alice has $4$ candies, and Bob has $4$ candies.

Another example is $[1, 10, 100]$. Then Alice can choose the second pile, Bob can choose the first pile, and candies from the third pile can be divided in such a way that Bob takes $54$ candies, and Alice takes $46$ candies. Now Bob has $55$ candies, and Alice has $56$ candies, so she has to discard one candy — and after that, she has $55$ candies too.


-----Input-----

The first line of the input contains one integer $q$ ($1 \le q \le 1000$) — the number of queries. Then $q$ queries follow.

The only line of the query contains three integers $a, b$ and $c$ ($1 \le a, b, c \le 10^{16}$) — the number of candies in the first, second and third piles correspondingly.


-----Output-----

Print $q$ lines. The $i$-th line should contain the answer for the $i$-th query — the maximum number of candies Alice can have after the division, if both Alice and Bob act optimally (of course, Bob will have the same number of candies).


-----Example-----
Input
4
1 3 4
1 10 100
10000000000000000 10000000000000000 10000000000000000
23 34 45

Output
4
55
15000000000000000
51
[{"code": "from sys import stdin,stdout\nimport sys\nimport math\n\nt=int(stdin.readline())\nfor i in range(t):\n    a=list(map(int,stdin.readline().split()))\n    print(sum(a)//2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "for i in range(int(input())):\n    a = list(map(int, input().split()))\n    print((a[0] + a[1] + a[2]) // 2)\n", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "ll= lambda : list(map(int,input().split()))\ntestcases=1\ntestcases=int(input())\nfor testcase in range(testcases):\n    [a,b,c]=ll()\n    print((a+b+c)//2)\n", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "import sys\n# sys.stdin.readline()\nt=int(sys.stdin.readline())\nfor i in range(t):\n    a=list(map(int,sys.stdin.readline().strip().split()))\n    op=sum(a)\n    print(op//2)\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "t=int(input())\nfor i in range(0,t):\n\tl=list(map(int,input().split()))\n\ts=sum(l)\n\ts=s//2\n\tprint(s)", "passed": true, "time": 1.69, "memory": 14116.0, "status": "done"}, {"code": "mod = 1000000007\nii = lambda : int(input())\nsi = lambda : input()\ndgl = lambda : list(map(int, input()))\nf = lambda : map(int, input().split())\nil = lambda : list(map(int, input().split()))\nls = lambda : list(input())\nn=ii()\nfor i in range(n):\n    a,b,c=f()\n    print((a+b+c)//2)", "passed": true, "time": 0.16, "memory": 14176.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a,b,c=map(int,input().split())\n    print((a+b+c)//2)", "passed": true, "time": 1.64, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\nfor _ in range(n):\n\tl = list(map(int, input().split()))\n\ts = sum(l)\n\tprint(s // 2)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\nfor i in range(n):\n    a, b, c = map(int, input().split())\n    print((a+b+c)//2)", "passed": true, "time": 0.16, "memory": 14152.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jul 14 12:40:58 2019\n\n@author: Hamadeh\n\"\"\"\nclass cinn:\n    def __init__(self):\n        self.x=[]\n    def cin(self,t=int):\n        if(len(self.x)==0):\n            a=input()\n            self.x=a.split()\n            self.x.reverse()\n        return self.get(t)\n    def get(self,t):\n        return t(self.x.pop())\n    def clist(self,n,t=int): #n is number of inputs, t is type to be casted\n        l=[0]*n\n        for i in range(n):\n            l[i]=self.cin(t)\n        return l\n    def clist2(self,n,t1=int,t2=int,t3=int,tn=2):\n        l=[0]*n\n        for i in range(n):\n            if(tn==2):\n                a1=self.cin(t1)\n                a2=self.cin(t2)\n                l[i]=(a1,a2)\n            elif (tn==3):\n                a1=self.cin(t1)\n                a2=self.cin(t2)\n                a3=self.cin(t3)\n                l[i]=(a1,a2,a3)\n        return l\n    def clist3(self,n,t1=int,t2=int,t3=int):\n        return self.clist2(self,n,t1,t2,t3,3)\n    def cout(self,i,ans=''):   \n        if(ans==''):\n            print(\"Case #\"+str(i+1)+\":\", end=' ')\n        else:\n            print(\"Case #\"+str(i+1)+\":\",ans)\n    def printf(self,thing):\n        print(thing,end='')\n    def countlist(self,l,s=0,e=None):\n        if(e==None):\n            e=len(l)\n        dic={}\n        for el in range(s,e):\n            if l[el] not in dic:\n                dic[l[el]]=1\n            else:\n                dic[l[el]]+=1\n        return dic\n    def talk (self,x):\n        print(x,flush=True)\n    def dp1(self,k):\n        L=[-1]*(k)\n        return L\n    def dp2(self,k,kk):\n        L=[-1]*(k)\n        for i in range(k):\n            L[i]=[-1]*kk\n        return L\n    def isprime(self,n):\n        if(n==1 or n==0):\n            return False\n        for i in range(2,int(n**0.5+1)):\n            if(n%i==0):\n                return False\n        return True\n    def factors(self,n):    \n        from functools import reduce\n        return set(reduce(list.__add__, \n                    ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))\n    def nthprime(self,n):\n        #usable up to 10 thousand\n        i=0\n        s=2\n        L=[]\n        while(i<n):\n            while(not self.isprime(s)):\n                s+=1\n            L.append(s)\n            s+=1\n            i+=1\n        return L\n    def matrixin(self,m,n,t=int):\n        L=[]\n        for i in range(m):\n            p=self.clist(n,t)\n            L.append(p)\n        return L\n    def seive(self,k):\n        #1000000 tops\n        n=k+1\n        L=[True]*n\n        L[1]=False\n        L[0]=False\n        for i in range(2,n):\n            if(L[i]==True):\n                for j in range(2*i,n,i):\n                    L[j]=False\n        return L\n    def seiven(self,n,L):\n        i=0\n        for j in range(len(L)):\n            if(L[j]==True):\n                i+=1\n            if(i==n):\n                return j\n    def matrixin2(self,m,t=int):\n        L=[]\n        for i in range(m):\n            iny=self.cin(str)\n            lsmall=[]\n            for el in iny:\n                lsmall.append(t(el))\n            L.append(lsmall)\n        return L\nc=cinn()\nque=c.cin()\nfor i in range(que):\n    q=c.cin()\n    x=c.cin()\n    z=c.cin()\n    print((x+z+q)//2)", "passed": true, "time": 0.16, "memory": 14604.0, "status": "done"}, {"code": "q=int(input())\nfor i in range(q):\n\ta,b,c=map(int,input().split())\n\tprint ((a+b+c)//2)", "passed": true, "time": 0.22, "memory": 14084.0, "status": "done"}, {"code": "for i in range(int(input())):\n    a,b,c=map(int, input().split())\n    print((a+b+c)//2)", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "q = int(input())\nfor Q in range(q):\n    A = [int(i) for i in input().split()]\n    A.sort()\n    alice = A[0]\n    bob = A[1]\n    excess = A[2]\n\n    total = sum(A)\n\n    each = total//2\n\n    print(each)\n", "passed": true, "time": 0.24, "memory": 14192.0, "status": "done"}, {"code": "import sys\ninput = lambda: sys.stdin.readline().strip()\n\nT = int(input())\nfor i in range(T):\n    a, b, c = list(map(int, input().split()))\n    print((a+b+c)//2)\n", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "Q = int(input())\nfor _ in range(Q):\n    a, b, c = list(map(int, input().split()))\n    print((a+b+c)//2)\n\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    l=list(map(int,input().split()))\n    a=sum(l)\n    print(a//2)", "passed": true, "time": 0.19, "memory": 14244.0, "status": "done"}, {"code": "import math\n\n\nclass Read:\n    @staticmethod\n    def int():\n        return int(input())\n\n    @staticmethod\n    def list(sep=' '):\n        return input().split(sep)\n\n    @staticmethod\n    def list_int(sep=' '):\n        return list(map(int, input().split(sep)))\n\n\ndef solve():\n    a, b, c = Read.list_int()\n    print((a + b + c) // 2)\n\n\nquery_count = Read.int()\nfor j in range(query_count):\n    solve()\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "#Anuneet Anand\nq=int(input())\nwhile q:\n\ta,b,c=list(map(int,input().split()))\n\tA=[a,b,c]\n\tprint(sum(A)//2)\n\tq=q-1\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "import sys\n\nt = int(input())\nfor i in range(t):\n    a, b, c = list(map(int, sys.stdin.readline().split()))\n    print((a+b+c)//2)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "q = int(input())\nfor _ in range(q):\n    a,b,c = list(map(int,input().split()))\n    sum = a+b+c\n    print(sum//2)\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "for i in range(int(input())):\n    a, b, c = list(map(int, input().split()))\n    print((a + b + c) // 2)\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    a = list(map(int,input().split()))\n    s = sum(a)\n    print(s//2)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}]