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

Difficulty: EASY

Solutions:
def f1(a, b, c):
	d1 = abs(a - b)
	d2 = min(c, d1)
	if a < b:
		a += d2
	else:
		b += d2
	c = (c - d2) // 2
	a += c
	b += c
	return min(a, b)

def f2(s):
	(a, b, c) = map(int, s.split())
	return max(f1(a, b, c), f1(b, c, a), f1(c, a, b))
q = int(input())
lines = [''] * q
for i in range(q):
	lines[i] = input()
for s in lines:
	print(f2(s))


def main():
	N = int(input())
	for i in range(N):
		res = sum([int(v) for v in input().split()])
		print(res // 2)
main()


q = int(input())
while q:
	q -= 1
	(a, b, c) = map(int, input().split())
	ans = (a + b + c) // 2
	print(ans)


for _ in range(int(input())):
	print(sum(map(int, input().split())) // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	ans = (a + b + c) // 2
	print(ans)


cases = int(input())
while cases:
	cases -= 1
	(a, b, c) = map(int, input().split())
	result = (a + b + c) // 2
	print(result)


import math
q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


for i in range(int(input())):
	li = [int(i) for i in input().split()]
	li.sort()
	a = li[0]
	b = li[1]
	c = li[2]
	if b - a > c - b:
		(a, b, c) = (c, a, b)
	print((a - (c - b)) // 2 + c)


a = 0
b = 0
for x in range(int(input())):
	piles = list(map(int, input().split()))
	piles = sorted(piles)
	a = piles[0]
	b = piles[1]
	if piles[2] < b - a:
		a += piles[2]
	else:
		piles[2] -= b - a
		a += b - a
		a += piles[2] // 2
	print(a)


q = int(input())
for i in range(q):
	(a, b, c) = list(map(int, input().split()))
	total = a + b + c
	print(total // 2)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	k = [a, b, c]
	k.sort()
	a = k[0]
	b = k[1]
	c = k[2]
	if b - a <= c:
		c -= b - a
		a = b
		print(b + c // 2)
	else:
		print(a + c)


t = int(input())
for _ in range(0, t):
	(a, b, c) = map(int, input().split())
	sum = a + b + c
	print(sum // 2)


n = int(input())
for _ in range(n):
	print(sum((int(x) for x in input().split())) // 2)


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	c = l[2]
	res = (a + b + c) // 2
	print(res)


ans = []
for i in range(int(input())):
	ans.append(sum(list(map(int, input().split()))) // 2)
for j in ans:
	print(j)


T = int(input())
for n in range(T):
	t = 0
	(a, b, c) = map(int, input().split())
	t = a + b + c
	if t % 2 == 0:
		t = t // 2
	else:
		t = (t - 1) // 2
	print(t)


n = int(input())
for i in range(n):
	arr = list(map(int, input().split()))
	a = sum(arr)
	print(a // 2)


def minimum_diff_pair(a, b, c):
	if abs(a - b) < abs(a - c):
		return [a, b, c] if abs(a - b) < abs(b - c) else [b, c, a]
	return [a, c, b] if abs(a - c) < abs(b - c) else [b, c, a]

def max_candies(a, b, c):
	(x, y, z) = minimum_diff_pair(a, b, c)
	return x + (z - (x - y)) // 2 if x > y else y + (z - (y - x)) // 2
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(max_candies(a, b, c))


for K in range(int(input())):
	c = list(map(int, input().split()))
	c.sort()
	print(c[0] + (c[1] + c[2] - c[0]) // 2)


n = int(input())
while n:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	ans = a + b + c
	if ans & 1 == 0:
		print(ans // 2)
	else:
		print((ans - 1) // 2)
	n -= 1


for j in range(int(input())):
	(x, y, z) = map(int, input().split())
	print((x + y + z) // 2)


test_case = int(input())
for _ in range(test_case):
	a = list(map(int, input().split()))
	print(sum(a) // 2)


q = int(input())
for qq in range(q):
	d = list(map(int, input().split()))
	mx = 0
	for i in range(3):
		for j in range(i):
			a = d[i]
			b = d[j]
			c = d[3 - i - j]
			aa = min(a, b)
			bb = max(a, b)
			if aa + c <= b:
				cur = aa + c
			else:
				cur = (aa + bb + c) // 2
			if cur > mx:
				mx = cur
	print(mx)


q = int(input())
list1 = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	d = (a + b + c) // 2
	list1.append(d)
for i in list1:
	print(i)


Q = int(input())
for _ in range(Q):
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)


q = int(input())
results = []
for _ in range(q):
	(a, b, c) = (int(x) for x in input().split())
	sum = a + b + c
	ans = sum // 2
	results.append(ans)
for i in results:
	print(i)


t = int(input())
for i in range(t):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	s = a + b + c
	print(s // 2)


for x in range(int(input())):
	a = list(map(int, input().split()))
	s = 0
	a.sort()
	alice = a[1]
	bob = a[0]
	fuck = a[2]
	if alice - bob <= fuck:
		fuck = fuck - (alice - bob)
		bob = bob + alice - bob
		bob = fuck // 2 + bob
		alice = fuck // 2 + alice
	else:
		bob = bob + a[2]
		a[2] = 0
	print(min(alice, bob))


T = int(input())
while T > 0:
	(n, x, y) = map(int, input().split())
	ans = (n + y + x) // 2
	print(ans)
	T = T - 1


q = int(input())
for i in range(0, q):
	(a1, a2, a3) = map(int, input().split())
	print((a1 + a2 + a3) // 2)


t = int(input())
while t:
	sum1 = 0
	l = list(map(int, input().split()))
	for i in l:
		sum1 = sum1 + i
	x = sum1 // 2
	print(x)
	t = t - 1


from sys import stdin
t = int(stdin.readline())
for i in range(t):
	(n, m, a) = map(int, input().strip().split())
	sum = n + m + a
	ans = sum // 2
	print(ans)


for i in range(int(input())):
	print(sum([int(x) for x in input().split()]) // 2)


q = int(input())
ans = []
for i in range(q):
	k = sum(list(map(int, input().split()))) // 2
	ans.append(k)
[print(i) for i in ans]


x = int(input())
while x:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	print(int((a + b + c) // 2))
	x -= 1


q = int(input())
M = []
a = 0
for i in range(q):
	M.append([int(el) for el in input().split()])
	a = sum(M[i])
	a = a // 2
	print(a)


t = int(input())
for o in range(t):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	s = (a + b + c) // 2
	print(s)


q = int(input())
for i in range(q):
	(x, y, z) = map(int, input().split(' '))
	s = x + y + z
	print(s // 2)


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	print(sum(a) // 2)


n = int(input())
for i in range(n):
	a = [int(x) for x in input().split()]
	print(sum(a) // 2)


q = int(input())
for i in range(q):
	x = 0
	(a, b, c) = map(int, input().split())
	x = max(a, b, c)
	y = min(a, b, c)
	z = a + b + c - x - y
	if y > z:
		w = y - z
		c = x - w
		if c % 2 == 0:
			print(y + int(c / 2))
		else:
			print(y + c // 2)
	else:
		w = z - y
		c = x - w
		if c % 2 == 0:
			print(z + int(c / 2))
		else:
			print(z + c // 2)


q = int(input())
for i in range(q):
	(a, b, c) = list(map(int, input().split()))
	r = max(a, b) - min(a, b)
	qnew = c - r
	res = max(a, b) + qnew // 2
	print(res)


q = int(input())
for Q in range(q):
	l = list(map(int, input().split()))
	l.sort()
	a = l[1]
	b = l[0]
	c = l[2]
	tempb = b
	b += a - b
	c -= a - tempb
	c = c // 2
	print(a + c)


n = int(input())
s = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	k = (a + b + c) // 2
	s.append(k)
for i in range(len(s)):
	print(s[i])


def process(A):
	q = sum(A)
	return q // 2
n = int(input())
for i in range(n):
	A = []
	for x in input().split():
		A.append(int(x))
	print(process(A))


q = int(input())
for i in range(0, q):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


S = int(input())
for s in range(S):
	p = 0
	(a, b, c) = map(int, input().split())
	p = a + b + c
	if p % 2 == 0:
		p = p // 2
	else:
		p = (p - 1) // 2
	print(p)


t = input()
while int(t) > 0:
	row = input()
	l = row.split(' ')
	l.sort(key=lambda x: int(x))
	a = int(l[0])
	b = int(l[1])
	c = int(l[2])
	print(sum([a, b, c]) // 2)
	t = int(t) - 1


for i in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	n = a + b + c
	print(n // 2)


for i in range(int(input())):
	arr = [int(i) for i in input().split()]
	tot = sum(arr)
	print(tot // 2)


q = int(input())
for x in range(q):
	(a, b, c) = [int(x) for x in input().split()]
	difab = abs(a - b)
	difac = abs(a - c)
	difbc = abs(b - c)
	m = min(difab, difac, difbc)

	def f(B, A, div):
		if B + div >= A:
			print((B + div + A) // 2)
		else:
			print(B + div)
	f(*sorted([a, b, c]))


q = int(input())
q > 0
z = int()
list1 = []
for i in range(1, q + 1):
	(a, b, c) = [int(x) for x in input().split()]
	z = (a + b + c) // 2
	list1.append(z)
for y in list1:
	print(y)


import math
import os
import random
import re
import sys

def function(a):
	tot = sum(a)
	if tot % 2 == 0:
		print(tot // 2)
	else:
		tot = tot - 1
		print(tot // 2)
count = int(input())
i = 0
while i != count:
	a = [int(x) for x in input().split()]
	function(a)
	i = i + 1


import math
for _ in range(int(input())):
	(m, n, k) = map(int, input().split())
	print((m + n + k) // 2)


t = int(input())
while t > 0:
	li = list(map(int, input().split(' ')))
	li.sort()
	if li[0] + li[1] == li[2]:
		print(li[2])
	else:
		(alice, bob) = (0, 0)
		alice += min(li)
		li.remove(min(li))
		bob += min(li)
		li.remove(min(li))
		var = abs(bob - alice) // 2
		var1 = li[0] // 2 - var
		var2 = li[0] - var1
		print(min(min(var1, var2) + bob, max(var1, var2) + alice))
	t -= 1


for i in range(int(input())):
	m = map(int, input().split())
	p = sum(m) // 2
	print(p)


a = int(input())
for x in range(a):
	b = list(map(int, input().split()))
	print(sum(b) // 2)


i = 0
i = int(input())
for j in range(i):
	a = list(map(int, input().split()))
	print((a[0] + a[1] + a[2]) // 2)


for x in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	s = a + b + c
	print(s // 2)


k = int(input())
for i in range(k):
	l = map(int, input().split())
	print(sum(l) // 2)


for i in range(int(input())):
	s = list(map(int, input().split()))
	print(sum(s) // 2)


Q = int(input())
for i in range(Q):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
for _testcases_ in range(int(input())):
	print(sum(get_list()) // 2)


n = int(input())
for i in range(n):
	(q, w, e) = [int(x) for x in input().split()]
	print((q + w + e) // 2)


x = int(input())
arr = []
for i in range(x):
	arr.append(list(map(int, input().split())))
for l in range(x):
	h = 0
	s = 0
	while h < 3:
		s = s + arr[l][h]
		h += 1
	print(s // 2)


T = int(input())
for i in range(T):
	s = input()
	s = s.split(' ')
	tot = int(s[0]) + int(s[1]) + int(s[2])
	print(tot // 2)


n = int(input())
while n:
	n -= 1
	lst = list(map(int, input().split()))
	if sum(lst) % 2 == 0:
		print(sum(lst) // 2)
	else:
		print((sum(lst) - 1) // 2)


q = int(input())
for _ in range(q):
	(t, l, r) = list(map(int, input().split()))
	print((t + l + r) // 2)


def findCandies(x, y, c):
	a = min(x, y)
	b = max(x, y)
	diff = b - a
	a = a + min(c, diff)
	c = c - min(c, diff)
	if c > 0:
		mid = int(c / 2)
		a += mid
		b += c - mid
	return min(a, b)
q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	res = max(findCandies(a, b, c), findCandies(b, c, a), findCandies(a, c, b))
	print(res)


def answer():
	nums = list(map(int, input().split(' ')))
	anss = []
	for (i0, i1, i2) in [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]:
		ans = mini_answer(nums[i0], nums[i1], nums[i2])
		anss.append(ans)
	ret = max(anss)
	return ret

def mini_answer(alice, bob, last):
	if alice + last <= bob:
		out = alice + last
	else:
		out = (alice + bob + last) // 2
	return out
n = int(input())
for _ in range(n):
	out = answer()
	print(out)


n = int(input())
h = []
for i in range(n):
	a = [int(i) for i in input().split()]
	c = 0
	for j in range(len(a)):
		c += a[j]
	h += [c // 2]
for i in h:
	print(i)


for i in range(int(input())):
	(a, b, c) = (int(j) for j in input().split())
	print((a + b + c) // 2)


q = int(input())
for _ in range(q):
	a = [int(i) for i in input().strip().split()]
	print(sum(a) // 2)


import math
n = int(input())
for _ in range(n):
	args = input().split(' ')
	for i in range(0, len(args)):
		args[i] = int(args[i])
	if args[0] + args[1] >= args[2] or args[0] + args[2] >= args[1] or args[1] + args[2] >= args[2]:
		print(sum(args) // 2)
	else:
		i = min(args)
		args.pop(i)
		print(str(i + min(args)))


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	sum = a + b + c
	print(sum // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = [int(x) for x in input().split()]
	l = [a, b, c]
	l.sort()
	x = l[1]
	y = l[0]
	m = l[1] - l[0]
	y += (l[2] - m) // 2 + m
	print(y)


q = int(input())
list = []
for i in range(0, q):
	(a, b, c) = [int(k) for k in input().split()]
	tot = a + b + c
	if tot % 2 == 0:
		list.append(tot // 2)
	else:
		tot = tot - 1
		list.append(tot // 2)
for j in range(0, len(list)):
	print(list[j])


n = int(input())
for i in range(n):
	(x, y, z) = map(int, input().split())
	dif = max(x, y) - min(x, y)
	z -= dif
	z = z // 2
	print(z + max(x, y))


__author__ = '#miner'
a = int(input())
for i in range(a):
	print(sum(list(map(int, input().split()))) // 2)


for _ in range(int(input())):
	p = [int(i) for i in input().split()]
	third = max(p[0], p[1], p[2])
	p.remove(third)
	if third > p[0] + p[1] or third > max(p[0], p[1]) - min(p[0], p[1]):
		print((p[0] + p[1] + third) // 2)
	else:
		print(min(p[0] - p[1]) + third)


for tc in [0] * int(input()):
	print(sum(map(int, input().split())) // 2)


import math
t = int(input())
for i in range(t):
	(A, B, C) = map(int, input().split())
	print((A + B + C) // 2)


for i in range(int(input())):
	(msk, s, k) = list(map(int, input().split()))
	print((msk + s + k) // 2)


import sys
t = int(input())
for x in range(t):
	N = list(map(int, input().split()))
	N.sort()
	if N[1] - N[0] < N[2] - N[1]:
		N[2] = N[2] - (N[1] - N[0])
		N[2] = N[2] // 2
		N[1] = N[1] + N[2]
		print(N[1])
	else:
		N[0] = N[0] - (N[2] - N[1])
		N[0] = N[0] // 2
		N[2] = N[2] + N[0]
		print(N[2])


a = int(input())
c = []
for i in range(a):
	b = [int(s) for s in input().split()]
	c.append((b[0] + b[1] + b[2]) // 2)
for i in c:
	print(i)


q = int(input())
for i in range(q):
	arr = [int(x) for x in input().split()]
	print(sum(arr) // 2)


q = int(input())
for i in range(q):
	abc = list(map(int, input().split()))
	print((abc[0] + abc[1] + abc[2]) // 2)


queries = int(input())
for i in range(queries):
	array = [int(value) for value in input().split()]
	maxValue = array.pop(array.index(max(array)))
	diff = abs(array[0] - array[1])
	if maxValue > diff:
		result = max(array) + (maxValue - diff) // 2
	else:
		result = min(array) + diff
	print(result)


t = int(input())
for _ in range(t):
	(n, m, k) = map(int, input().split())
	print((n + m + k) // 2)


q = int(input())
for i in range(1, q + 1):
	(a, b, c) = [int(x) for x in input().split()]
	print((a + b + c) // 2)


import sys
n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


q = int(input())
for i in range(0, q):
	(a, b, c) = [int(s) for s in input().split()]
	x = (a + b + c) // 2
	print(x)


q = int(input())
for i in range(q):
	x = []
	x = [int(j) for j in input().split()]
	y = sum(x)
	z = y // 2
	print(int(z))


import math
n = int(input())
while n > 0:
	l = [int(x) for x in input().split()]
	d = (l[0] + l[1] + l[2]) // 2
	print(d)
	n -= 1


q = int(input())
abc = [list(map(int, input().split())) for _ in range(q)]
for abci in abc:
	print(sum(abci) // 2)


q = int(input())
for row in range(q):
	lst = list(map(int, input().split()[:3]))
	print(sum(lst) // 2)


from collections import deque
import sys

def inp():
	return sys.stdin.readline().strip()
for _ in range(int(inp())):
	a = list(map(int, inp().split()))
	a.sort()
	alice = 0
	bob = 0
	for i in range(len(a) - 1):
		if i % 2 == 0:
			alice += a[i]
		else:
			bob += a[i]
	rem = a[-1]
	(alice, bob) = (max(alice, bob), min(alice, bob))
	diff = alice - bob
	if diff >= rem:
		bob += diff
	else:
		rem -= diff
		bob = alice
		if rem % 2 != 0:
			rem -= 1
		alice += rem // 2
		bob += rem // 2
	print(bob)


n = int(input())
for i in range(n):
	sweets = input()
	swts_list = list(map(int, sweets.split(' ')))
	swts_list = sorted(swts_list)
	min1 = swts_list[0]
	min2 = swts_list[1]
	min3 = swts_list[2]
	min3 -= min2 - min1
	min1 += min3 // 2 + min2 - min1
	print(min1)


u = int(input())
for j in range(0, u):
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	a = (x + y + z) // 2
	print(a)


R = lambda : map(int, input().split())
for _ in range(int(input())):
	print(sum(R()) // 2)


a = []
for _ in range(int(input())):
	a.append(sum(map(int, input().split())) // 2)
[print(i) for i in a]


for _ in range(int(input())):
	(m, s, k) = list(map(int, input().split()))
	print((m + s + k) // 2)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	Q = Scanner.int()
	for _ in range(Q):
		S = Scanner.map_int()
		print(sum(S) // 2)
main()


for i in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	if a[0] == a[2]:
		print(a[0] + a[2] // 2)
	else:
		x = a[1] - a[0]
		a[0] += x
		a[2] -= x
		a[0] += a[2] // 2
		a[1] += a[2] // 2
		print(min(a[0], a[1]))


t = int(input())
while t:
	(x, y, z) = map(int, input().split())
	print((x + y + z) // 2)
	t -= 1


t = int(input())
while t > 0:
	sum = 0
	t = t - 1
	(a, b, c) = input().split()
	sum = sum + int(a) + int(b) + int(c)
	print(sum // 2)


for hm in range(int(input())):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


q = int(input())
l = list()
for i in range(q):
	n = input()
	lst = list()
	n = n.split()
	for i in n:
		i = int(i)
		lst.append(i)
	s = sum(lst) // 2
	l.append(s)
for i in l:
	print(i)


q = int(input())
t = []
for i in range(0, q, 1):
	l = list(map(int, input().strip().split()))
	t.append((l[0] + l[1] + l[2]) // 2)
for i in range(0, q, 1):
	print(f'{t[i]}')


for _ in range(int(input())):
	s = sum([int(i) for i in input().split()])
	print(s // 2)


n = int(input())
ansar = []
for i in range(n):
	x = list(map(int, input().split()))
	ansar.append(sum(x) // 2)
print(*ansar, sep='\n')


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	l = []
	l.append(a)
	l.append(b)
	l.append(c)
	l.sort
	bob = 0
	if l[2] < l[1] + l[0]:
		alice = l[2]
		bob = l[1]
		diff = alice - bob
		if diff > l[0]:
			bob = bob + l[0]
		else:
			bob = bob + diff + (l[0] - diff) // 2
	else:
		bob = l[0] + l[1]
		l[2] = l[2] - bob
		bob = bob + l[2] // 2
	print(bob)


n = int(input())
for i in range(n):
	z = list(map(int, input().split()))
	k = sum(z)
	print(k // 2)


q = int(input())
k = 0
while k < q:
	(x, y, w) = [int(a) for a in input().split()]
	k += 1
	print((x + y + w) // 2)


T = int(input())
for i in range(T):
	(x, y, z) = map(int, input().split())
	avg = (x + y + z) // 2
	print(avg)


n = int(input())
l = []
k = 0
for i in range(n):
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	c = (x + y + z) // 2
	l.append(c)
for j in range(k, k + n):
	print(l[j])
	k = k + 1


tt = int(input())
while tt:
	l = [int(s) for s in input().split()]
	print(sum(l) // 2)
	tt -= 1


for _ in range(int(input())):
	l = [int(i) for i in input().split()]
	print(sum(l) // 2)


def calculate(arr):
	tot = sum(arr)
	return tot // 2
q = int(input())
for i in range(q):
	arr = list((int(x) for x in input().split()[:3]))
	print(calculate(arr))


def solve():
	a = list(map(int, input().split()))
	a.sort()
	if a[2] > a[1] - a[0]:
		a[2] -= a[1] - a[0]
		ans = a[1] + a[2] // 2
	else:
		ans = a[0] + a[2]
	print(ans)

def main():
	t = 1
	if t == 0:
		test = 1
	else:
		test = int(input())
	for _ in range(test):
		solve()
main()


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	net = a + b + c
	print(net // 2)


import math
t = int(input())
for i in range(t):
	arr = [int(j) for j in input().split()]
	arr.sort()
	print((arr[0] + arr[1] + arr[2]) // 2)


from collections import Counter, defaultdict, deque
t = int(input())
for i in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	print((a + b + c) // 2)


t = int(input())
l = []
for i in range(t):
	(x, y, z) = input().split(' ')
	k = int(x) + int(y) + int(z)
	l.append(k // 2)
for i in l:
	print(i)


def f(a, b, c):
	m = abs(a - b)
	if m > c:
		return min(a, b) + c
	else:
		return max(a, b) + (c - m) // 2
q = int(input())
for i in range(q):
	(a, b, c) = list(map(int, input().split()))
	print(max(f(a, b, c), f(a, c, b), f(b, a, c), f(b, c, a), f(c, a, b), f(c, b, a)))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = b + c - a
	if x % 2 == 0:
		print(a + x // 2)
	else:
		print(a + x // 2)


import math
q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	arr = [a, b, c]
	arr.sort()
	alice = arr[0]
	bob = arr[1]
	quotient = (alice + bob + arr[2]) // 2
	alice += math.ceil(quotient - alice)
	bob += math.floor(quotient - bob)
	print(max(alice, bob))


n = int(input())
for i in range(n):
	(p, q, r) = map(int, input().split())
	k = p + q + r
	print(k // 2)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(t,) = I()
while t:
	t -= 1
	(a, b, c) = I()
	ans = a + b + c
	print(ans // 2)


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	c = (x + y + z) // 2
	print(c)


def main():
	q = int(input())
	for i in range(q):
		(a, b, c) = map(int, input().split())
		print((a + b + c) // 2)
main()


def main():
	q = int(input())
	for i in range(q):
		s = [int(x) for x in input().split()]
		Alisa = s[0] + s[2] // 2
		Bob = s[1] + (s[2] - s[2] // 2)
		d = abs(Alisa - Bob)
		mini = min(Alisa, Bob)
		if d == 0:
			print(Alisa)
		else:
			if d > 1:
				ans = mini + d // 2
			else:
				ans = mini
			print(ans)
main()


queries = int(input())
for i in range(queries):
	candies = list(map(int, input().split(' ')))
	print(sum(candies) // 2)


for i in range(int(input())):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	(a, b, c) = sorted([a, b, c])
	diff = b - a
	c -= diff
	cd = c // 2
	print(b + cd)


t = int(input())
while t:
	a = list(map(int, input().split()))
	ans = 0
	for i in range(len(a)):
		ans += a[i]
	print(ans // 2)
	t -= 1


q = int(input())
for i in range(q):
	l = list(map(int, input().split()))
	l.sort()
	diff = min(l[1] - l[0], l[2])
	l[2] -= diff
	l[0] += diff
	ans = min(l[0], l[1]) + l[2] // 2
	print(ans)


t = int(input())
for i in range(t):
	arr = list(map(int, input().split()))
	arr.sort()
	alice = arr[0]
	bob = arr[1]
	x = bob - alice
	if arr[2] == 0:
		print(min(alice, bob))
	arr[2] = arr[2] - x
	if arr[2] % 2 == 0:
		alice += x
		alice += int(arr[2] / 2)
		bob += int(arr[2] / 2)
		print(min(alice, bob))
	else:
		alice += x
		alice += int((arr[2] + 1) / 2)
		bob += int((arr[2] + 1) / 2) - 1
		print(min(alice, bob))


import sys

def solve(l):
	d1 = l[1] - l[0]
	d2 = l[2] - l[1]
	if d1 < d2:
		return l[1] + (l[2] - d1) // 2
	else:
		return l[2] + (l[0] - d2) // 2
q = int(input())
for i in range(q):
	(a, b, c) = map(int, sys.stdin.readline().split())
	l = [a, b, c]
	l.sort()
	ans = solve(l)
	print(ans)


def f(x, y, z):

	def ff(x, y, z):
		d = abs(x - z)
		left = y - d
		if left > 0:
			return max(x, z) + left // 2
		else:
			return min(x, z) + y
	return max(ff(x, y, z), ff(x, z, y), ff(y, x, z))
q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	print(f(a, b, c))


from collections import defaultdict as dd
import math
import sys
import heapq
for _ in range(int(input())):
	print(sum([int(i) for i in input().split()]) // 2)


q = int(input())
a = []
for i in range(q):
	p = list(map(int, input().split()))
	ans = sum(p) // 2
	print(ans)


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))
t = ii()
for i in range(t):
	a = sum(list(mi()))
	print(a // 2)


q = int(input())
while q > 0:
	arr = [int(x) for x in input().split()]
	s = sum(arr)
	if s % 2 == 0:
		print(s // 2)
	else:
		print((s - 1) // 2)
	q -= 1


q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().strip().split())
	s = a + b + c
	print(s // 2)


a = int(input())
for x in range(0, a):
	b = input().strip().split(' ')
	for y in range(0, 3):
		b[y] = int(b[y])
	g = 0
	com = []
	while g < 3:
		if g == 0:
			ali = b[1]
			bob = b[2]
		elif g == 1:
			ali = b[2]
			bob = b[0]
		else:
			ali = b[0]
			bob = b[1]
		if ali > bob:
			if b[g] <= ali - bob:
				com.append(b[g] + bob)
			else:
				b[g] -= ali - bob
				com.append(ali + b[g] // 2)
		elif ali < bob:
			if b[g] <= bob - ali:
				com.append(b[g] + ali)
			else:
				b[g] -= bob - ali
				com.append(bob + b[g] // 2)
		else:
			com.append(bob + b[g] // 2)
		g += 1
	print(max(max(com[0], com[1]), com[2]))


for _ in '0' * int(input()):
	print(sum(map(int, input().split())) // 2)


q = int(input())
for m in range(q):
	poop = input().split()
	poop = [int(a) for a in poop]
	nart = sum(poop)
	print(nart // 2)


a = int(input())
for j in range(a):
	parts = input().split()
	counter = 0
	for i in range(len(parts)):
		counter += int(parts[i])
	if counter % 2 == 0:
		print(counter // 2)
	else:
		print((counter - 1) // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = [int(i) for i in input().split()]
	l = [a, b, c]
	l.sort()
	(a, b, c) = l
	diff = b - a
	if c >= diff:
		c -= diff
		c -= c % 2
		print(b + c // 2)
	else:
		print(a + c)


import math
n = int(input())
for i in range(n):
	k = [int(i) for i in input().split()]
	av = sum(k) // 2
	print(av)


q = int(input())
for i in range(q):
	a = list(map(int, input().split()))
	a.sort()
	k = a[1] + (a[2] - a[1] + a[0]) // 2
	print(k)


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	print((l[0] + l[1] + l[2]) // 2)


import sys
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(a, b, c) = sorted(int_array())
	print((a + b + c) // 2)


test = int(input())
for cases in range(test):
	(a, b, c) = map(int, input().split())
	res = (a + b + c) // 2
	print(res)


q = int(input())
for w in range(q):
	A = list(map(int, input().split()))
	x = A[0] + A[1] + A[2]
	if x % 2 == 0:
		print(x // 2)
	else:
		print((x - 1) // 2)


q = int(input())
while q:
	(a, b, c) = map(int, input().split())
	A = [a, b, c]
	print(sum(A) // 2)
	q = q - 1


for case in range(int(input())):
	print(sum(list(map(int, input().split()))) // 2)


q = int(input())
for _ in range(q):
	arr = sorted(list(map(int, input().split())))
	alisa = arr[1]
	bob = arr[0]
	diff = alisa - bob
	bob += diff
	arr[2] -= diff
	alisa += arr[2] // 2
	bob += arr[2] // 2
	print(min(alisa, bob))


n = int(input())
for i in range(0, n):
	(x, y, z) = [int(i) for i in input().split()]
	if (x + y + z) % 2 == 0:
		print((x + y + z) // 2)
	else:
		print((x + y + z) // 2)


q = int(input())
for i in range(q):
	piles = [int(i) for i in input().split()]
	piles.sort()
	print(piles[1] + (piles[2] - (piles[1] - piles[0])) // 2)


q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	total = a + b + c
	while total % 2 != 0:
		total -= 1
	print(total // 2)


t = int(input())
for q in range(0, t):
	a = [int(i) for i in input().split()]
	a.sort()
	alice = a[1]
	bob = a[0]
	if a[2] + bob < alice:
		print(a[2] + bob)
	else:
		s = alice - bob
		bob += s
		m = (a[2] - s) // 2
		print(alice + m)


from functools import reduce
n = int(input())
for i in range(0, n):
	scores = list(map(int, input().split()))
	sum = reduce(lambda x, y: x + y, scores)
	print(sum // 2)


n = int(input())
main_l = list()
for i in range(n):
	row = list((int(i) for i in input().split(' ')))
	main_l.append(row)
for l in main_l:
	print(int(sum(l) // 2))


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	print((a[0] + a[1] + a[2]) // 2)
	t -= 1


import sys

def main():
	sys.stdin.readline()
	for l in sys.stdin:
		(a, b, c) = [int(x) for x in l.strip().split()]
		print((a + b + c) // 2)
main()


n = int(input())
count = 0
l = []
while count < n:
	s = input()
	l.append(s.split(' '))
	count += 1
for x in l:
	n1 = int(x[0])
	n2 = int(x[1])
	n3 = int(x[2])
	k = [n1, n2, n3]
	k = sorted(k)
	diff = k[1] - k[0]
	k[2] = k[2] - diff
	k[1] += k[2] // 2
	print(k[1])


def metodo(piles):
	maximum = max(piles)
	minimum = min(piles)
	x = 0
	for i in range(2):
		if piles[x] == maximum or piles[x] == minimum:
			x = x + 1
	medium = x
	return (minimum + maximum + medium) // 2
queries = int(input())
for i in range(queries):
	line = input()
	line = line.split()
	print((int(line[0]) + int(line[1]) + int(line[2])) // 2)


n = int(input())
for x in range(n):
	k = input().split()
	k = [int(x) for x in k]
	print(sum(k) // 2)


n = int(input())
for i in range(n):
	(bob, alice, pile) = map(int, sorted(input().split()))
	x = alice - bob
	bob += x
	pile -= x
	alice += pile // 2
	print(alice)


n = int(input())
d = []
for i in range(n):
	a = list(map(int, input().split()))
	d.append(sum(a) // 2)
print('\n'.join((str(a) for a in d)))


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	a.sort()
	b = a[0]
	c = a[1]
	d = abs(b - c)
	e = a[2] - d
	b = max(c, b)
	c = max(c, b)
	print(b + e // 2)


n = int(input())
for i in range(1, n + 1):
	(x, y, z) = [int(i) for i in input().split()]
	print((x + y + z) // 2)


q = int(input(''))
for i in range(q):
	l = [int(x) for x in input('').split()]
	f = l[0]
	s = l[1]
	t = l[2]
	print((f + s + t) // 2)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
import collections
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())
mod = 1000000007
inf = float('inf')

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
t = ii()
while t:
	t -= 1
	(a, b, c) = mi()
	a1 = max(a, b)
	b1 = min(a, b)
	a = max(a1, c)
	c1 = min(a1, c)
	b = max(b1, c1)
	c = min(b1, c1)
	ans = b
	a -= b - c
	ans += a // 2
	print(ans)


for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	if (a + b + c) % 2 == 0:
		print((a + b + c) // 2)
	else:
		print((a + b + c - 1) // 2)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def bfs(g, st, lcatable, level):
	visited = [0] * len(g)
	visited[st] = 1
	queue = []
	queue.append(st)
	new = []
	while len(queue) != 0:
		s = queue.pop()
		new.append(s)
		for i in g[s]:
			if visited[i] == 0:
				level[i] = level[s] + 1
				lcatable[i][0] = s
				visited[i] = 1
				queue.append(i)
	return new

def lcatable(g, n, level):
	mx = 0
	while 2 ** mx <= n:
		mx += 1
	lcatable = [[-1] * mx for i in range(n + 1)]
	bfs(g, 1, lcatable, level)
	for j in range(1, mx):
		for i in range(1, n + 1):
			if lcatable[i][j - 1] != -1:
				lcatable[i][j] = lcatable[lcatable[i][j - 1]][j - 1]
	return lcatable

def dist(x0, y0, x1, y1):
	return abs(x0 - x1) + abs(y0 - y1)

def solve():
	a = lis()
	print(sum(a) // 2)
testcase(int(inp()))


q = int(input())
for _ in range(q):
	a = [int(x) for x in input().split()]
	print(sum(a) // 2)


test = int(input())
while test:
	test -= 1
	q = list(map(int, input().split(' ')))
	s = sum(q)
	print(s // 2)


def solve(num1, num2, num3):
	return round((num1 + num2 + num3) // 2)
line = input().split(' ')
output = ''
for i in range(int(line[0])):
	(num1, num2, num3) = map(int, input().split(' '))
	output += str(solve(num1, num2, num3)) + '\n'
print(output)


n = int(input())
for i in range(n):
	a = list(map(int, input().split(' ')))
	if sum(a) % 2 == 0:
		print(sum(a) // 2)
	else:
		print((sum(a) - 1) // 2)


q = int(input())
for _ in range(q):
	A = list(map(int, input().split()))
	A.sort()
	alice = A[0]
	bob = A[1]
	diff = bob - alice
	alice += diff
	remaining = (A[2] - diff) // 2
	print(alice + remaining)


N = int(input())
while N > 0:
	N -= 1
	ls = list(map(int, input().strip().split()))
	ls.sort()
	ls[2] -= ls[1] - ls[0]
	x = ls[2] // 2
	print(ls[1] + x)


n = int(input())
while n:
	n -= 1
	a = input()
	a = a.split(' ')
	a = [int(_) for _ in a]
	print(sum(a) // 2)


T = int(input())
for i in range(T):
	l = list(map(int, input().split()))
	l.sort()
	x = (l[2] + l[1] - l[0]) // 2
	print(min(l[0] + x, l[1] + l[2] - x))


q = int(input())
for _ in range(q):
	l = [int(x) for x in input().split()]
	x = sum(l)
	if x % 2:
		print((x - 1) // 2)
	else:
		print(x // 2)


n = int(input())
for i in range(0, n):
	arr = [int(num) for num in input().split()]
	print(sum(arr) // 2)


q = int(input())
for i in range(q):
	a = sorted(list(map(int, input().split())))
	print(a[0] + (a[1] - a[0]) + (a[2] - (a[1] - a[0])) // 2)


import decimal
for _ in range(int(input())):
	s = sum(list(map(int, input().split())))
	print(int(decimal.Decimal(s) / decimal.Decimal(2)))


def main():
	t = int(input())
	for i in range(t):
		(a, b, c) = tuple(map(int, input().split()))
		print((a + b + c) // 2)
main()


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	sorted(a)
	if a[0] + a[1] == a[2]:
		print(a[2])
	else:
		alice = a[1]
		bob = a[0]
		bob += a[1] - a[1]
		a[2] -= a[1] - a[0]
		alice += a[2] // 2
		print(alice)
	t -= 1


q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	if (a + b + c) % 2 == 1:
		print((a + b + c - 1) // 2)
	else:
		print((a + b + c) // 2)


import math
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(int(a + b + c >> 1))


def check(arr):
	c = sorted(arr)
	a = c[0]
	b = c[1]
	d = b - a
	e = c[2] - d
	f = e // 2
	g = b + f
	print(g)
n = int(input())
for i in range(n):
	l = 3
	arr = list(map(int, input().strip().split()))[:l]
	check(arr)
	arr = []


t = int(input())
for _ in range(t):
	l = [int(x) for x in input().split()]
	print(sum(l) // 2)


n = int(input())
while n > 0:
	(a, b, c) = map(int, input().split())
	ans = (a + b + c) // 2
	print(ans)
	n = n - 1


q = int(input())
for _ in range(q):
	(a, b, c) = sorted(list(map(int, input().split())))
	if b - a >= c:
		print(a + c)
		continue
	else:
		print(b + (c - (b - a)) // 2)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
from math import ceil, floor
for query in range(read_int()):
	(a, b, c) = sorted(read_int_array())
	print((a + b + c) // 2)


t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	k = sum(l)
	print(k // 2)


import sys
import math
from collections import defaultdict
n = int(input())
for _ in range(n):
	a = list(map(int, input().split()))
	print(sum(a) // 2)


q = int(input())
for i in range(q):
	l = [int(j) for j in input().split()]
	a = sum(l)
	print(a // 2)


q = int(input())
for _ in range(q):
	A = sorted([int(x) for x in input().split()])
	print(min([A[1] + A[2], sum(A) // 2]))


q = int(input())
for _ in range(q):
	(a, b, c) = (int(i) for i in input().strip().split(' '))
	print((a + b + c) // 2)


q = int(input())
for query in range(q):
	(a, b, c) = map(int, input().split(' '))
	res = a + b + c
	res = res // 2
	print(res)


import math
n = int(input())
ans = []
for i in range(n):
	(x, y, z) = input().split()
	ans.append((int(x) + int(y) + int(z)) // 2)
for i in range(n):
	print(ans[i])


def max_candy(p):
	alice = 0
	bob = 0
	a = min(p)
	c = max(p)
	alice += a
	p.remove(a)
	b = min(p)
	bob += b
	x = (c + (b - a)) // 2
	alice += x
	bob += c - x
	return min(alice, bob)
q = int(input())
for i in range(q):
	p = list(map(int, input().split()))
	print(max_candy(p))


import math
for i in range(int(input())):
	z = map(int, input().split())
	print(sum(z) // 2)


q = int(input())
while q > 0:
	q -= 1
	lst = [int(x) for x in input().split()]
	a = sum(lst) // 2
	print(a)


q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	(x, y, z) = (a, b, c)
	p = (x - y - z) // -2
	q = z - p
	assert p + q == z
	x += p
	y += q
	ans = min(x, y)
	print(ans)


for _ in range(int(input())):
	(a, b, c) = sorted(map(int, input().split()))
	if a + b == c:
		print(c)
	else:
		c -= b - a
		print(c // 2 + b)


import sys
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
from collections import defaultdict as df
import random
infinite = float('inf')
t = int(input())
for _ in range(t):
	(a, b, c) = RI()
	maxo = 0
	temp = c
	if a < b:
		n = a
		m = b
	else:
		n = b
		m = a
	if m - n < temp:
		temp -= m - n
		maxo = max(maxo, m + temp // 2)
	else:
		maxo = max(maxo, n + temp)
	temp = a
	if b < c:
		n = b
		m = c
	else:
		n = c
		m = b
	if m - n < temp:
		temp -= m - n
		maxo = max(maxo, m + temp // 2)
	else:
		maxo = max(maxo, n + temp)
	temp = b
	if a < c:
		n = a
		m = c
	else:
		n = c
		m = a
	if m - n < temp:
		temp -= m - n
		maxo = max(maxo, m + temp // 2)
	else:
		maxo = max(maxo, n + temp)
	print(maxo)


t = int(input())
for i in range(t):
	p = list(map(int, input().split()))
	r = sum(p)
	w = sum(p) // 2
	t = 0
	if r % 2 == 1:
		q = sum(p) // 2
		t = 1
		print(q)
	else:
		print(w)


q = int(input())
pos = [[0, 1, 2], [0, 2, 1], [1, 2, 0]]
for i in range(0, q):
	ln = [int(j) for j in input().split(' ')]
	m = 0
	for j in pos:
		a = ln[j[0]]
		b = ln[j[1]]
		c = ln[j[2]]
		oa = a
		n = max(a, min(a + c, b))
		a = n
		c -= a - oa
		ob = b
		n = max(b, min(b + c, a))
		b = n
		c -= b - ob
		if a != b:
			continue
		m = max(m, a + c // 2)
	print(m)


t = int(input())
while t > 0:
	ar = [int(x) for x in input().strip(' ').split(' ')]
	s = 0
	s = sum(ar)
	if s % 2 == 0:
		print(s // 2)
	else:
		print((s - 1) // 2)
	t -= 1


q = int(input())
for _ in range(q):
	s = list(map(int, input().split()))
	(a, b, c) = (s[0], s[1], s[2])
	print((a + b + c) // 2)


q = int(input())
for i in range(1, q + 1):
	s = input()
	a = []
	a = s.split(' ')
	b = []
	for j in a:
		x = int(j)
		b.append(x)
	x = 0
	for j in b:
		x = x + j
	print(x // 2)


q = int(input())
ans = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	ans.append((a + b + c) // 2)
for i in range(q):
	print(ans[i])


n = int(input())
s = []
for i in range(n):
	a = [int(x) for x in input().split()]
	res = int((a[0] + a[1] + a[2]) // 2)
	s.append(res)
for i in s:
	print(i)


in1 = int(input())
for i in range(in1):
	in2 = input().split()
	s = int(in2[0]) + int(in2[1]) + int(in2[2])
	print(s // 2)


def handle():
	a = [int(x) for x in input().split()]
	print(sum(a) // 2)
t = int(input())
for i in range(t):
	handle()


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	soma = a + b + c
	result = soma // 2
	print(result)


q = int(input())
answers = [0] * q
for i in range(q):
	candString = input().split()
	candies = [0] * 3
	for j in range(3):
		candies[j] = int(candString[j])
	candies.sort()
	if candies[0] - candies[1] > candies[2]:
		ans = candies[1] + candies[2]
	else:
		ans = (candies[0] + candies[1] + candies[2]) // 2
	answers[i] = ans
for i in range(q):
	print(answers[i])


for _ in range(int(input())):
	a = [int(o) for o in input().split()]
	a = sorted(a)
	print(sum(a) // 2)


Q = int(input())
for q in range(Q):
	(n1, n2, n3) = map(int, input().split())
	N = n1 + n2 + n3
	if N % 2 == 0:
		N = N // 2
	else:
		N = (N - 1) // 2
	print(N)


import sys

class AThreePilesOfCandies:

	def solve(self):
		import math
		q = int(input())
		for _ in range(q):
			(a, b, c) = sorted([int(_) for _ in input().split()])
			print((a + b + c) // 2)
solver = AThreePilesOfCandies()
input = sys.stdin.readline
solver.solve()


q = int(input())
x = []
for i in range(1, q + 1):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	s = a + b + c
	r = s // 2
	x.insert(i - 1, r)
for j in range(0, q):
	k = x[j]
	print(k)


n = int(input())
for i in range(0, n):
	ls = [int(i) for i in input().split()]
	count = ls[0]
	val = ls[1] - ls[0]
	val2 = (ls[2] - val) // 2
	print(count + val + val2)


t = int(input())
result = []
for _ in range(t):
	(a, b, c) = map(int, input().split())
	result.append((a + b + c) // 2)
for x in result:
	print(x)


q = int(input())
for i in range(q):
	x = sum(list(map(int, input().split())))
	if x % 2 == 0:
		print(x // 2)
	else:
		print((x - 1) // 2)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	sum1 = a + b + c
	if sum1 % 2 == 0:
		print(sum1 // 2)
	else:
		print((sum1 - 1) // 2)


q = int(input())
for i in range(q):
	l = [int(elem) for elem in input().split()]
	s = 0
	for i in range(len(l)):
		s += l[i]
	print(s // 2)


for _ in range(int(input())):
	(a, b, d) = map(int, input().split())
	if a >= b and a >= d:
		if a < abs(b - d):
			print(min(b, d) + a)
		else:
			print(max(b, d) + (a - abs(b - d)) // 2)
	elif b >= a and b >= d:
		if b < abs(a - d):
			print(min(a, d) + b)
		else:
			print(max(a, d) + (b - abs(a - d)) // 2)
	elif d >= a and d >= b:
		if d < abs(b - a):
			print(min(b, a) + d)
		else:
			print(max(b, a) + (d - abs(b - a)) // 2)


import sys
input = sys.stdin.readline
n = int(input())
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	sums = a + b + c
	print(sums // 2)


q = int(input())
ans = []
import itertools
for i in range(q):
	(a, b, c) = map(int, input().split())
	t = 0
	ans.append((a + b + c) // 2)
for i in range(q):
	print(ans[i])


def ain():
	return map(int, input().split())
for _ in range(int(input())):
	(a, b, c) = ain()
	print((a + b + c) // 2)


t = int(input())
while t > 0:
	l = input().split(' ')
	sum = int(l[0]) + int(l[1]) + int(l[2])
	print(sum // 2)
	t = t - 1


q = int(input())
while q:
	(a, b, c) = map(int, input().split())
	l = []
	if abs(a - b) > c:
		l.append(abs(a - b) - c)
	else:
		l.append((c - abs(a - b)) % 2)
	if abs(c - b) > a:
		l.append(abs(c - b) - a)
	else:
		l.append((a - abs(c - b)) % 2)
	if abs(a - c) > b:
		l.append(abs(a - c) - b)
	else:
		l.append((b - abs(a - c)) % 2)
	print((a + b + c - min(l)) // 2)
	q -= 1


for _ in range(int(input())):
	a = list(map(int, input().split()))
	m = max(a)
	alice = 0
	bob = 0
	if a[0] == m:
		alice = a[1]
		bob = a[2]
	if a[1] == m:
		alice = a[0]
		bob = a[2]
	if a[2] == m:
		alice = a[1]
		bob = a[0]
	diff = abs(alice - bob)
	upper = (m + diff) // 2
	lower = (m - diff) // 2
	if alice > bob:
		alice = alice + lower
		bob += upper
	else:
		bob += lower
		alice += upper
	print(bob)


from math import floor
for _ in range(int(input())):
	candy = list(map(int, input().split()))
	total = candy[0] + candy[1] + candy[2]
	if total % 2 != 0:
		total -= 1
	result = total // 2
	print(result)


q = int(input())
izpis = [0] * q
for i in range(0, q):
	array = [0] * 3
	a = 0
	b = 0
	array = list(map(int, input().split()))
	a += array[0]
	b += array[1]
	if a >= b:
		o = a - b
		b += o
		array[2] -= o
		oo = array[2] // 2
		a += oo
		b += oo
	else:
		o = b - a
		a += o
		array[2] -= o
		oo = array[2] // 2
		a += oo
		b += oo
	izpis[i] = a
for j in range(0, q):
	print(str(izpis[j]))


t = int(input())
for _ in range(t):
	lis = list(map(int, input().split()))
	lis = sorted(lis)
	alice = lis[0]
	bob = lis[1]
	if alice <= bob:
		diff = bob - alice
	else:
		diff = alice - bob
	lis[2] = lis[2] - diff
	print(max(alice, bob) + lis[2] // 2)


N = int(input())
while N != 0:
	(A, B, C) = map(int, input().split())
	print((A + B + C) // 2)
	N -= 1


def main():
	(d1, d2, d3) = map(int, input().split())
	return (d1 + d2 + d3) // 2
t = int(input())
for i in range(t):
	print(main())


z = int(input())
for x in range(z):
	m = list(map(int, input().strip().split()[:4]))
	print(sum(m) // 2)


import math
for _ in range(int(input())):
	arr = sorted(list(map(int, input().split())))
	a = arr[0]
	b = arr[1]
	if a < b:
		val = min(b - a, arr[2])
		a += val
		arr[2] -= val
	if b < a:
		val = min(a - b, arr[2])
		b += val
		arr[2] -= val
	a += arr[2] // 2
	b += arr[2] // 2
	print(a)


import math
from sys import stdin, stdout
from bisect import bisect_left, bisect_right

def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def freq(l):
	f = {}
	for i in l:
		if i in f:
			f[i] += 1
		else:
			f[i] = 1
	return f
inp = lambda : int(stdin.readline())
sip = lambda : stdin.readline()
mulip = lambda : map(int, stdin.readline().split())
lst = lambda : list(map(int, stdin.readline().split()))
slst = lambda : list(sip())
for _ in range(inp()):
	A = [int(x) for x in input().split()]
	print(sum(A) // 2)


q = int(input())
for i in range(q):
	print(sum([int(i) for i in input().split()]) // 2)


t = int(input(''))
for i in range(0, t):
	a = input('')
	sum = 0
	for j in a.split(' '):
		sum = sum + int(j)
	print(sum // 2)


n = int(input())
for i in range(n):
	numbers = map(int, input().split())
	number = sum(numbers)
	print(number // 2)


q = int(input())
for i in range(q):
	w = list(map(int, input().split()))
	print(sum(w) // 2)


t = int(input())
for i in range(t):
	ans = 0
	a = list(map(int, input().split()))
	a.sort()
	if a[2] >= a[1] - a[0]:
		print(a[1] + (a[2] - a[1] + a[0]) // 2)
	else:
		print(a[0] + a[2])


n = int(input())
while n > 0:
	(a, b, c) = map(int, input().split(' '))
	e = max(a, b, c)
	f = min(a, b, c)
	g = a + b + c - e - f
	give = g - f
	print(g + (e - give) // 2)
	n -= 1


q = int(input())

def solve(a):
	a.sort()
	t1 = a[0] + a[2]
	t2 = a[1]
	if t1 <= t2:
		return t1
	return t1 + (t2 - t1) // 2
for _ in range(q):
	a = list(map(int, input().split()))
	print(solve(a))


qeue = int(input())
for _ in range(qeue):
	(a, b, c) = map(int, input().split())
	d0 = c - b
	d1 = b - a
	if d0 <= d1:
		alc = c
		bob = b
		a -= c - b
		b += c - b
		print(b + a // 2)
	else:
		alc = b
		bob = a
		c -= b - a
		a += b - a
		print(a + c // 2)


q = int(input())
while q != 0:
	s = 0
	(a, b, c) = map(int, input().split())
	s = (a + b + c) // 2
	print(s)
	q -= 1


for _ in range(int(input())):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	sum = a + b + c
	print(sum // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	L = [a, b, c]
	L.sort(reverse=True)
	if (L[2] - (L[0] - L[1])) % 2 == 0:
		ans = sum(L) // 2
	else:
		ans = (sum(L) - 1) // 2
	print(ans)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	s = sum(l)
	print(s // 2)


t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	x = (a + b + c) // 2
	print(x)
	t -= 1


def helper(a, b, c):
	fir = a
	sec = b
	if a - b > 0:
		if a - b <= c:
			c = c - (a - b)
			b = b + (a - b)
		else:
			b += c
			c = 0
	elif b - a <= c:
		c = c - (b - a)
		a = a + (b - a)
	else:
		a += c
		c = 0
	if c == 0:
		if a == b:
			return a
		else:
			return min(a, b)
	else:
		temp = c // 2
		a += temp
		b += temp
		return a
q = int(input())
for i in range(q):
	s = input()
	(q, w, e) = s.split(' ')
	(q, w, e) = (int(q), int(w), int(e))
	alice = 0
	bob = 0
	maxm = 0
	f1 = helper(q, w, e)
	f2 = helper(q, e, w)
	f3 = helper(w, q, e)
	f4 = helper(w, e, q)
	f5 = helper(e, q, w)
	f6 = helper(e, w, q)
	if f1 > maxm:
		maxm = f1
	if f2 > maxm:
		maxm = f2
	if f3 > maxm:
		maxm = f3
	if f4 > maxm:
		maxm = f4
	if f5 > maxm:
		maxm = f5
	if f6 > maxm:
		maxm = f6
	print(maxm)


q = int(input())
for i in range(0, q):
	a = input().split(' ')
	s = 0
	for k in range(0, 3):
		s = s + int(a[k])
	print(str(s // 2))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = a + b + c
	print(d // 2)


n = int(input())
hasil = 0
for i in range(n):
	angka = input().split()
	for j in angka:
		hasil += int(j)
	print(hasil // 2)
	hasil = 0


import math
n = int(input())
for i in range(n):
	s = [int(i) for i in input().split(' ')]
	a = s[0]
	b = s[1]
	c = s[2]
	print((a + b + c) // 2)


q = int(input())
lst = list()
for i in range(q):
	data = input().split()
	data.sort()
	alice = int(data[0])
	bob = int(data[1])
	rem = int(data[2]) - (bob - alice)
	rem_div = rem // 2
	final = bob + rem_div
	lst.append(final)
for k in lst:
	print(k)


for i in range(int(input())):
	print(sum([int(a) for a in input().split()]) // 2)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().rstrip().split())
	su = a + b + c
	print(su // 2)


import sys
import math
from collections import defaultdict
DEBUG = True
fast = sys.stdin.readline
fasti = lambda : fast().split('\n')[0]
listInt = lambda : [int(x) for x in fasti().split(' ')]
listStr = lambda : [x for x in fasti().split(' ')]
readInt = lambda : int(fasti())
readStr = lambda : fasti()

def whatIs(value, name=''):
	if not DEBUG:
		return
	print(f'[{name}: {value}]')

def solve():
	l = listInt()
	l = sorted(l)
	(a, b, c) = l
	diff = b - a
	a = b
	c -= diff
	a += c // 2
	print(a)
t = readInt()
for _ in range(t):
	solve()


def solution(query):
	return sum(query) // 2

def main():
	queries = int(input())
	for i in range(queries):
		query = []
		query = list(map(int, input().split()))
		print(solution(query))
main()


q = int(input())
for i in range(q):
	nums = input().split()
	total = int(nums[0]) + int(nums[1]) + int(nums[2])
	print(total // 2)


queries = int(input())
for _ in range(queries):
	line = list(map(int, input().split()))
	print(sum(line) // 2)


import sys
n = int(next(sys.stdin))
for _ in range(n):
	(a, b, c) = map(int, next(sys.stdin).split(' '))
	print((a + b + c) // 2)


t = int(input())

def f(a, b, c):
	if b < a:
		(a, b) = (b, a)
	d = min(c, b - a)
	c -= d
	a += d
	return a + c // 2
for _ in range(t):
	l = list(map(int, input().split()))
	print(max([f(l[i], l[i - 1], l[i - 2]) for i in range(3)]))


n = int(input())
for i in range(n):
	x = list(map(int, input().split()))
	x.sort()
	x_max = max(x)
	x_min = min(x)
	print((x_max - (x[1] - x_min)) // 2 + x[1])


l = []
n = int(input())
for i in range(1, n + 1):
	s = 0
	del l
	l = []
	l = list(map(int, input().split()))
	for j in range(0, 3):
		s = s + l[j]
	if s % 2 == 0:
		print(s // 2)
	else:
		print((s - 1) // 2)


def main():
	n = int(input())
	for i in range(n):
		data = sum(list(map(int, input().split())))
		print(data // 2)
main()


def solution():
	(a, b, c) = [int(i) for i in input().split()]
	print((a + b + c) // 2)
N = int(input())
for i in range(N):
	solution()


import sys
t = int(input())
for i in range(t):
	(a, b, c) = map(int, sys.stdin.readline().split())
	print((a + b + c) // 2)


qq = int(input())
while qq > 0:
	qq = qq - 1
	(a, b, c) = [int(x) for x in input().split()]
	q = a + b + c
	if q % 2 == 0:
		print(q // 2)
	else:
		print((q - 1) // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = sorted(map(int, input().split()))
	print(b + (c - (b - a)) // 2)


T = int(input())
for i in range(T):
	N = list(map(int, input().split()))
	A = N[0] + N[1] + N[2]
	print(A // 2)


import math
from collections import Counter
t = int(input())
while t > 0:
	l = list(map(int, input().split()))
	a = sum(l)
	print(a // 2)
	t -= 1


def count(candy):
	two = candy[0] + candy[1] + candy[2]
	return two // 2
q = int(input())
ans = []
for i in range(q):
	ans.append(count(list(map(int, input().split()))))
print('\n'.join(map(str, ans)))


q = int(input())
lis = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	l = sorted([a, b, c])
	p = (l[2] - (l[1] - l[0])) // 2
	r = l[1] + p
	lis.append(r)
for i in range(q):
	print(lis[i])


n = int(input())
for tc in range(n):
	(a, b, c) = map(int, input().split())
	ans = a + b + c
	print(ans // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = [int(t) for t in input().split(' ')]
	print((a + b + c) // 2)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = []
	for _ in range(n):
		(a, b, c) = LI()
		l.append(sum([a, b, c]) // 2)
	for x in l:
		print(x)
main()


q = int(input())
for qurey in range(q):
	l = list(map(int, input().split()))
	print(sum(l) // 2)


number_of_queries = int(input())
_array = []
for i in range(0, number_of_queries):
	(first_candle_pile, second_candle_pile, third_candle_pie) = map(int, input().split())
	answer = (first_candle_pile + second_candle_pile + third_candle_pie) // 2
	_array.append(answer)
	if i == number_of_queries - 1:
		for j in range(0, len(_array)):
			print(_array[j])


q = int(input())
result = []
for i in range(q):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	c = int(s[2])
	result.append((a + b + c) // 2)
for i in range(len(result)):
	print(result[i])


queries = int(input())
for i in range(queries):
	(a, b, c) = input().split()
	total = int(a) + int(b) + int(c)
	print(total // 2)


q = int(input())
ans = []
for i in range(q):
	summ = 0
	inp = input().split(' ')
	for j in inp:
		summ += int(j)
	ans.append(summ // 2)
for i in ans:
	print(i)


from collections import defaultdict
import math
t = int(input())
for _ in range(t):
	(x, y, z) = map(int, input().split())
	print((x + y + z) // 2)


t = int(input())
m = 0
while m < t:
	s1 = list(map(int, input().split()))
	print(sum(s1) // 2)
	m = m + 1


q = int(input())
s = []
for i in range(q):
	s1 = 0
	(a, b, c) = map(int, input().split())
	s1 = a + b + c
	if s1 % 2 == 0:
		s += [s1 // 2]
	else:
		s += [s1 // 2]
for j in s:
	print(j)


n = int(input())
for _ in range(n):
	candies = sum(map(int, input().split()))
	print(candies // 2)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print((max(a, b) + c - min(a, b)) // 2 + min(a, b))


q = int(input())
for _ in range(q):
	l = []
	(a, b, c) = list(map(int, input().split()))
	avg = (a + b + c) // 2
	print(avg)


for i in range(int(input())):
	data = list(map(int, input().split()))
	data.sort()
	print((data[2] - (data[1] - data[0])) // 2 + data[1])


n = int(input())
for el in range(n):
	a = list(map(int, input().split()))
	sum = a[0] + a[1] + a[2]
	print(sum // 2)


t = int(input())
for i in range(t):
	l = [int(x) for x in input().split(' ')]
	s = sum(l)
	print(s // 2)


q = int(input())
out = []
for i in range(q):
	(a, b, c) = list(map(int, input().split(' ')))
	out.append((a + b + c) // 2)
for o in out:
	print(o)


T = int(input())
for _ in range(T):
	arr = [int(x) for x in input().split()]
	print(sum(arr) // 2)


import os

def main():
	t = int(input())
	for i in range(t):
		li = list(map(int, input().split()))
		s = sum(li)
		print(s // 2)
main()


from decimal import Decimal
for _ in range(int(input())):
	candies = list(map(int, input().split()))
	candies_sum = Decimal(sum(candies))
	print(int(candies_sum / 2))


from math import *
n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


n = int(input())
for _ in range(n):
	arr = list(map(int, input().split()))
	print(sum(arr) // 2)


a = int(input())
for i in range(a):
	z = list(map(int, input().split()))
	z.sort()
	z[-1] -= z[-2] - z[0]
	print(max(z[0], z[1]) + z[-1] // 2)


q = int(input())
for i in range(q):
	a = sorted([int(x) for x in input().split()])
	t = a[0]
	s = a[1]
	ras = a[1] - a[0]
	dop = (a[2] - ras) // 2 + ras
	print(min(t + dop, s + a[2] - dop))


t = int(input())
for i in range(0, t):
	l = list(map(int, input().split()))
	s = sum(l)
	s = s // 2
	print(s)


x = int(input())
z = []
for i in range(0, x):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	z.append((a + b + c) // 2)
for i in range(0, x):
	print(z[i])


q = int(input())
while q > 0:
	q = q - 1
	(a, b, c) = [int(x) for x in input().split()]
	res = (a + b + c) // 2
	print(res)


for _ in range(int(input())):
	li = list(map(int, input().split()))
	print(sum(li) // 2)


n = int(input())
answers = []
for i in range(n):
	heaps = [int(x) for x in input().split()]
	answers.append(sum(heaps) // 2)
for answer in answers:
	print(answer)


x = input()
m = []
for i in range(0, int(x)):
	y = input()
	z = y.split()
	candy = [int(d) for d in z]
	q = sum(candy)
	if q % 2 == 0:
		print(q // 2)
	else:
		print((q - 1) // 2)
print(*m)


t = int(input())
while t > 0:
	(a, b, c) = list(map(int, input().split()))
	su = a + b + c
	print(su // 2)
	t = t - 1


import math
t = int(input())
while t > 0:
	t -= 1
	s = input()
	s = sorted(list(map(int, s.split())))
	s = s[0] + s[1] + s[2]
	print(int(s) // 2)


import math
for i in range(int(input())):
	a = list(map(int, input().split()))
	sum = 0
	for j in a:
		sum += j
	print(sum // 2)


t = int(input())
while t:
	l = list(map(int, input().split()))
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	alice = 0
	bob = 0
	flag = 0
	if a + b >= c:
		alice += c
		bob += b
		flag = 1
	else:
		alice += b
		bob += a
	if flag == 1:
		a = a - (c - b)
		alice += a // 2
	else:
		c = c - (b - a)
		alice += c // 2
	print(alice)
	t -= 1


list1 = []
for i in range(int(input())):
	list1.append(sum(list(map(int, input().split()))) // 2)
for i in list1:
	print(i)


t = int(input())
array = []
for i in range(t):
	x = list(map(int, input().split()))
	array.append(x)
for k in array:
	k.sort()
	print((k[2] + k[1] + k[0]) // 2)


import math
q = int(input())
for x in range(q):
	(a, b, c) = [int(x) for x in input().split()]
	print((a + b + c) // 2)


t = int(input())
while t:
	t = t - 1
	a = sum(map(int, input().split())) // 2
	print(a)


t = int(input())
r = [0 for i in range(t)]
for i in range(t):
	s = input().split()
	a = int(s[0]) + int(s[1]) + int(s[2])
	if a % 2 == 0:
		r[i] = a // 2
	else:
		r[i] = (a - 1) // 2
for i in range(t):
	print(r[i])


for q in range(int(input())):
	print(sum([int(x) for x in input().split()]) // 2)


for _ in range(int(input())):
	(x, y, z) = list(map(int, input().split()))
	print(int((x + y + z) // 2))


def aveg(a, b, c):
	return (a + b + c) // 2

def main():
	n = int(input())
	arr = []
	r = 0
	for i in range(n):
		(a, b, c) = input().split()
		a = int(a)
		b = int(b)
		c = int(c)
		r = aveg(a, b, c)
		arr.append(r)
	for i in range(n):
		print(arr[i])
main()


q = input('')
q = int(q)
outs = []
for i in range(q):
	query = input('')
	pile = query.split()
	Sum = 0
	alice = 0
	bob = 0
	for j in range(3):
		pile[j] = int(pile[j])
		Sum = Sum + pile[j]
	if Sum % 2 == 0:
		outs.append(Sum // 2)
	else:
		pile.sort()
		alice = pile[0]
		bob = pile[1]
		alice = alice + int(pile[2] // 2)
		bob = bob + int(pile[2] // 2)
		alice = alice + int((bob - alice) // 2)
		outs.append(alice)
for i in range(q):
	print(outs[i])


n = int(input())
output = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	output.append((a + b + c) // 2)
for i in output:
	print(i)


k = int(input())
for _ in range(k):
	nums = [int(x) for x in input().split()]
	print(sum(nums) // 2)


n = int(input())
for i in range(n):
	all = list(map(int, input().split()))
	print(sum(all) // 2)


t = int(input())
for case in range(t):
	print(sum([int(s) for s in input().split(' ')]) // 2)


def solve():
	(a, b, c) = [int(x) for x in input().split(' ')]
	return (a + b + c) // 2
q = int(input())
for i in range(q):
	ans = solve()
	print(ans)


for _ in range(int(input())):
	a = sorted(list(map(int, input().split())))
	ans = a[0] + a[1] + a[2]
	print(ans // 2)


for _ in range(int(input())):
	L = list(map(int, input().strip().split(' ')))
	print(sum(L) // 2)


q = int(input())
for i in range(q):
	v = [int(i) for i in input().split()]
	res = sum(v)
	res = res // 2
	print(res)


import math
import sys
n = int(sys.stdin.readline().strip())
for i in range(n):
	piles = list(map(int, sys.stdin.readline().split()))
	piles = sorted(piles)
	alice = piles[1]
	bob = piles[0]
	rem = piles[2]
	print((alice + bob + rem) // 2)


t = int(input())
for i in range(t):
	piles = [int(x) for x in input().split()]
	piles.sort()
	a = piles[-1]
	a -= a - int(sum(piles) // 2)
	print(a)


n = int(input())
i = 0
while i < n:
	nums = input().split()
	nums = [int(x) for x in nums]
	r = sum(nums)
	r = r // 2
	print(r)
	i += 1


n = int(input())
b = []
for i in range(n):
	a = list(map(int, input().split()))
	b.append(a)
for i in b:
	print(sum(i) // 2)


q = int(input())
for i in range(q):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	arr = [a, b, c]
	arr.sort()
	alex = arr[0]
	bob = arr[1]
	diff = abs(alex - bob)
	left = arr[2]
	if left >= diff:
		alex += diff
		left -= diff
	else:
		alex += left
		left = 0
	if left > 0:
		alex += left - left // 2
		bob += left // 2
	print(min(alex, bob))


n = int(input())
for i in range(n):
	(a, b, c) = sorted(list(map(int, input().split())))
	print((a + b + c) // 2)


for _ in range(int(input())):
	lst = list(map(int, input().split()))
	lst.sort()
	a = lst[0]
	b = lst[1]
	c = lst[2]
	diff = abs(a - b)
	c = c - diff
	size = b + c // 2
	print(size)


n = int(input())
result = []
for _ in range(n):
	arr = map(int, input().split())
	result.append(str(sum(arr) // 2))
print('\n'.join(result))


t = int(input())
while t:
	t -= 1
	a = sorted([int(x) for x in input().split()])
	print((a[2] - (a[1] - a[0])) // 2 + a[1])


n = int(input())
while n:
	n = n - 1
	(a, b, c) = [int(x) for x in input().split()]
	print((a + b + c) // 2)


q = int(input())
for i in range(q):
	a = input().split()
	print((int(a[0]) + int(a[1]) + int(a[2])) // 2)


kol_ = int(input())
for i in range(kol_):
	a = [int(el) for el in input().split()]

	def answer(i, i1, i2):
		res1 = i
		res2 = i1
		if res1 < res2:
			p = res2 - res1
			res1 += min(i2, res2 - res1)
			i2 -= min(i2, p)
		elif res2 < res1:
			p = res1 - res2
			res2 += min(i2, res1 - res2)
			i2 -= min(i2, p)
		res1 += i2 // 2
		res2 += i2 // 2
		return min(res1, res2)
	w = answer(a[0], a[1], a[2])
	w1 = answer(a[0], a[2], a[1])
	w2 = answer(a[1], a[0], a[2])
	w3 = answer(a[1], a[2], a[0])
	w4 = answer(a[2], a[1], a[0])
	w5 = answer(a[2], a[0], a[1])
	print(max(w, w1, w2, w3, w4, w5))


from itertools import permutations
for i in range(int(input())):
	a = sorted(map(int, input().split()))
	ans = [a[0], a[1]]
	diff = a[1] - a[0]
	ans[0] += diff
	a[2] -= diff
	print(ans[0] + a[2] // 2)


q = int(input())
readints = lambda : map(int, input().strip('\n').split())
for _ in range(q):
	v = list(readints())
	v.sort()
	(a, b, c) = v
	c -= b - a
	print(b + c // 2)


import math

def power(x, y, p):
	res = 1
	x = x % p
	while y > 0:
		if y & 1 == 1:
			res = res * x % mod
		y = y >> 1
		x = x * x % mod
	return res

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * power(den, p - 2, p) % p

def modInverse(a, p):
	return power(a, p - 2, p)

def modFact(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * modInverse(i, p) % p
	return res
mod = 1000000007
t = int(input())
while t != 0:
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)
	t -= 1


n = int(input())
for i in range(1, n + 1):
	s = input()
	a = s.split(' ')
	res = 0
	for j in range(0, 3):
		res += int(a[j])
	res = res // 2
	print(res)


print('\n'.join([str(sum(list(map(int, input().strip().split(' ')))) // 2) for _ in range(int(input()))]))


t = int(input())
for z in range(t):
	(a, b, c) = map(int, input().split())
	arr = [a, b, c]
	arr.sort()
	(a, b, c) = arr
	print(b + (c - (b - a)) // 2)


import sys
from sys import stdin
from collections import Counter
import itertools
from math import floor, ceil
from collections import deque

def input():
	return sys.stdin.readline().strip()

def dinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def rt(l, r, m, k):
	y = r - l + 1
	if y % m:
		y //= m
		y += 1
		return y * k
	y //= m
	return y * k

def main():
	(a, b, c) = sorted(rlinput())
	c -= b - a
	print(b + c // 2)
for i in range(dinput()):
	main()


n = int(input())
sum0 = []
for i in range(0, n):
	(pile1, pile2, pile3) = input().split()
	intpile1 = int(pile1)
	intpile2 = int(pile2)
	intpile3 = int(pile3)
	sum0.append((intpile1 + intpile2 + intpile3) // 2)
for i in range(len(sum0)):
	print(sum0[i])


q = int(input())
for w in range(q):
	iarr = list(map(int, input().split()))
	a = iarr[0]
	b = iarr[1]
	c = iarr[2]
	print((a + b + c) // 2)


S = int(input())
s = 0
while s < S:
	tot = 0
	(a, b, c) = map(int, input().split())
	tot = a + b + c
	if tot % 2 == 0:
		tot = tot // 2
	else:
		tot = (tot - 1) // 2
	print(tot)
	s += 1


q = int(input())
for _ in range(q):
	(alice, bob, c) = sorted([int(x) for x in input().split()])
	c -= bob - alice
	alice += bob - alice
	alice += c // 2
	print(alice)


test = int(input())
while test:
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)
	test -= 1


IN = input
rint = lambda : int(IN())
rmint = lambda : map(int, IN().split())
rlist = lambda : list(rmint())

def f(a, b, c):
	x = a
	y = b
	if x < y:
		p = min(y - x, c)
		c -= p
		x += p
	elif x > y:
		p = min(x - y, c)
		c -= p
		y += p
	x += c // 2
	y += c // 2
	return min(x, y)
n = rint()
for i in range(n):
	(a, b, c) = rmint()
	print(max((f(a, b, c), f(a, c, b), f(c, b, a))))


x = int(input())
for i in range(x):
	(n, m, o) = input().split()
	n = int(n)
	m = int(m)
	o = int(o)
	a = n + m + o
	z = a // 2
	print(z)


for i in range(int(input())):
	(*b,) = map(int, input().split())
	print(sum(b) // 2)


inp = int(input())
for i in range(inp):
	arr = list(map(int, input().split()))
	print(sum(arr) // 2)


x = eval(input())
for i in range(x):
	(a, b, c) = map(int, input().split())
	s = (a + b + c) // 2
	print(s)


q = int(input())
for i in range(q):
	a = input().strip().split(' ')
	for j in range(3):
		a[j] = int(a[j])
	sum = a[0] + a[1] + a[2]
	print(str(sum // 2))


for t in range(int(input())):
	piles = [int(i) for i in input().split()]
	piles.sort()
	if piles[0] == piles[1] and piles[1] == piles[2]:
		print(piles[0] + piles[1] // 2)
	elif piles[0] + piles[1] == piles[2]:
		print(piles[2])
	else:
		alice = piles[0]
		bob = piles[1]
		d = bob - alice
		piles[2] -= d
		alice += d
		print(alice + piles[2] // 2)


Q = int(input())
for q in range(Q):
	(a, b, c) = [int(x) for x in input().split(' ')]
	ans = (a + b + c) // 2
	print(ans)


I = lambda : map(int, input().split())
for _ in range(int(input())):
	li = list(I())
	li.sort()
	(a, b, c) = (li[0], li[1], li[2])
	if c >= b - a:
		ans = b + (c - (b - a)) // 2
	else:
		ans = a + (b - a)
	print(ans)


n = eval(input())
list1 = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	g = a + b + c
	list1.append(g)
list2 = list(map(int, list1))
for i in range(n):
	if list2[i] % 2 == 0:
		print(list2[i] // 2)
	else:
		print((list2[i] - 1) // 2)


from sys import stdin, stdout, exit
q = int(input())
for it in range(q):
	(a, b, c) = map(int, stdin.readline().split())
	asa = [a, b, c]
	ans = 0
	for i in range(3):
		a = asa[(i + 1) % 3]
		b = asa[(i + 2) % 3]
		if a > b:
			tmp = b
			b = a
			a = tmp
		if a + asa[i] <= b:
			ans = max(ans, a + asa[i])
		else:
			x = a + asa[i] - b
			ans = max(ans, x // 2 + b)
	stdout.write(str(ans) + '\n')


for q in range(int(input())):
	arr = sorted([int(s) for s in input().split()])
	print(sum(arr) // 2)


q = int(input())
for i in range(q):
	data = input().split()
	L = []
	for i in range(len(data)):
		L.append(int(data[i]))
	print(sum(L) // 2)


from sys import stdin
q = int(stdin.readline())
for i in range(q):
	(a, b, c) = map(int, stdin.readline().split())
	s = a + b + c
	print(s // 2)


q = int(input())
ins = lambda : list(map(int, input().split(' ')))
for _ in range(q):
	sums = sum(ins())
	print(sums // 2)


t = int(input())
for i in range(t):
	li = [int(x) for x in input().split()]
	li.sort()
	(a, b) = (li[0], li[1])
	res = 0
	diff = b - a
	if diff == 0:
		res = a + li[2] // 2
	elif diff > li[2]:
		a = a + li[2]
		res = b - a
	else:
		li[2] = li[2] - diff
		res = b + li[2] // 2
	print(res)


n = int(input())
for x in range(n):
	(a, b, c) = list(map(int, input().split()))
	su = a + b + c
	m = su % 2
	if m == 0:
		print(su // 2)
	else:
		print(su // 2)


def main():
	t = int(input())
	while t > 0:
		t -= 1
		(a, b, c) = map(int, input().split())
		print((a + b + c) // 2)
	return
main()


for tc in [0] * int(input()):
	s = list(map(int, input().split()))
	print(sum(s) // 2)


for _ in range(int(input())):
	sum = 0
	a = list(map(int, input().strip().split()))[:3]
	for i in range(3):
		sum += a[i]
	print(sum // 2)


t = int(input())
for case in range(t):
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)


q = int(input())
l = list()
while q:
	s = 0
	p = input()
	a = p.index(' ')
	b = a
	a = int(p[:a])
	p = p[b + 1:]
	b = p.index(' ')
	c = b
	b = int(p[:b])
	p = p[c + 1:]
	c = int(p)
	s += a + b + c
	s //= 2
	l.append(s)
	q = q - 1
for i in l:
	print(i)


s = int(input())
for i in range(s):
	c = sorted(list(map(int, input().split())))
	a = c[0]
	b = c[1]
	print(a + (c[2] - a + b) // 2)


q = int(input())
result = str()
for _ in range(q):
	inp = list(map(int, input().split()))
	res = sum(inp) // 2
	result = f'{result}\n{res}'.strip()
print(result)


n = input()
for each in range(0, int(n)):
	(a, b, c) = input().split()
	print((int(a) + int(b) + int(c)) // 2)


from math import *
from itertools import *
from collections import *
from bisect import *
for _ in range(int(input())):
	lst = [int(x) for x in input().split()]
	lst.sort()
	(a, b, c) = lst
	c -= b - a
	ans = b + c // 2
	print(ans)


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def main():
	q = rsingle_int()
	for i in range(q):
		a = rmult_int()
		sum = 0
		for el in a:
			sum += el
		print(int(sum // 2))
main()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)


q = int(input())
a = []
b = []
c = []
d = []
for i in range(q):
	h = input().split(' ')
	a.append(int(h[0]))
	b.append(int(h[1]))
	c.append(int(h[2]))
	d.append((a[i] + b[i] + c[i]) // 2)
for j in range(q):
	print(d[j])


import math
q = int(input())
while q:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	q -= 1
	print((a + b + c) // 2)


for _ in range(int(input())):
	A = [int(i) for i in input().split()]
	A.sort()
	alice = A[0]
	bob = A[1]
	rem = bob - alice
	div = (A[2] - rem) // 2
	print(bob + div)


q = int(input())
for o in range(q):
	a = [int(i) for i in input().split()]
	print(sum(a) // 2)


t = int(input())
for T in range(t):
	l = [int(x) for x in input().split()]
	total = sum(l)
	print(total // 2)


case = int(input())
for i in range(case):
	(x, y, z) = (int(v) for v in input().split())
	print((x + y + z) // 2)


q = int(input())
while q:
	(a, b, c) = map(int, input().split())
	if a + b >= c or b + c >= a or c + a >= b:
		print((a + b + c) // 2)
	else:
		d = [a, b, c]
		d.sort()
		print((d[0] + d[2] - d[1]) // 2)
	q -= 1


def fun(a):
	s = sum(a)
	print(s // 2)
for i in range(int(input())):
	a = list(map(int, input().split()))
	fun(a)


n = int(input())
while n > 0:
	(a, b, c) = [int(i) for i in input().split()]
	print((a + b + c) // 2)
	n = n - 1


import time

def distributeCandies(candies):
	sum = candies[0] + candies[1] + candies[2]
	maxCandies = sum // 2
	return maxCandies

def solve():
	queries = int(input())
	for x in range(queries):
		candyPiles = [int(y) for y in input().split(' ')]
		print(distributeCandies(candyPiles))
solve()


import sys
cases = int(input())
for i in range(cases):
	print(sum([int(x) for x in input().split()]) // 2)


total_Case = int(input())
case = []
solution = []
for i in range(total_Case):
	temp = input().strip().split()
	candies = [int(num) for num in temp]
	candies.sort()
	case.append(candies)

def get_Sol(i):
	temp = i[1] - i[0]
	if i[2] - temp >= 0:
		temp = i[2] - temp
		return temp // 2 + i[1]
	else:
		return i[0] + i[2]
for i in range(total_Case):
	solution.append(get_Sol(case[i]))
for sol in solution:
	print(sol)


q = int(input())
for i in range(q):
	(q, a, b) = map(int, input().split())
	sum = q + a + b
	final = sum // 2
	print(final)


import math
t = int(input())
while t:
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)
	t = t - 1


n = int(input())
for i in range(n):
	lst = sorted(list(map(int, input().split())))
	a = lst[0]
	b = lst[1]
	c = lst[2]
	dif = b - a
	c -= dif
	print(max(a, b) + c // 2)


t = int(input())
while t > 0:
	nums = list(map(int, input().split()))
	sum1 = sum(nums)
	sum1 = sum1 // 2
	print(sum1)
	t -= 1


q = int(input())
for i in range(q):
	(a, b, c) = [int(i) for i in input().split()]
	d = (a + b + c) // 2
	print(d)


class Solution(object):

	def getMaxCandies(self, n: int):
		for _ in range(n):
			print(sum(map(int, input().split())) // 2)
n = int(input())
sol = Solution()
result = sol.getMaxCandies(n)


y = int(input())
for x in range(0, y):
	(a, b, c) = map(int, input().split())
	n = (a + b + c) // 2
	print(n)


def func():
	p = int(input())
	for i in range(p):
		(a, b, c) = [int(e) for e in input().split()]
		num = (a + b + c) / 2
		print((a + b + c) // 2)
func()


def f(a, b, c):
	if a >= b:
		if a - b <= c:
			c = c - (a - b)
			a = a + c // 2
		else:
			a = b + c
	elif b - a <= c:
		c = c - (b - a)
		a = a + c // 2
	else:
		a = a + c
	return a
n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	if f(a, b, c) >= f(a, c, b):
		n = f(a, b, c)
	else:
		n = f(a, c, b)
	if f(b, a, c) >= f(b, c, a):
		m = f(b, a, c)
	else:
		m = f(b, c, a)
	if f(c, a, b) >= f(c, b, a):
		k = f(c, a, b)
	else:
		k = f(c, b, a)
	if k >= n and k >= m:
		print(k)
	elif m >= n and m >= k:
		print(m)
	else:
		print(n)


import collections
import math
t = int(input())
for _ in range(t):
	a = [int(x) for x in input().split()]
	a.sort()
	(alice, bob) = (0, 0)
	extra = a[1] - a[0]
	alice = a[0]
	bob = a[1]
	alice += min(extra, a[2])
	remainder = a[2] - min(extra, a[2])
	alice += remainder // 2
	print(alice)


def candies(lst):
	return sum(lst) // 2
q = int(input())
a = list()
for i in range(q):
	s = [int(j) for j in input().split()]
	a.append(candies(s))
for elem in a:
	print(elem)


N = int(input())
for i in range(0, N):
	(x, y, z) = [int(i) for i in input().split()]
	print((x + y + z) // 2)


t = input()
for r in range(int(t)):
	(x, y, z) = map(int, input().split())
	s = x + y + z
	print(s // 2)


t = int(input())
for _ in range(t):
	l = list(map(int, input().strip().split()))
	l.sort()
	(a, b, c) = (l[0], l[1], l[2])
	d = b - a
	c = c - d
	e = c // 2
	print(b + e)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a + b + c & 1:
		print(a + b + c - 1 >> 1)
	else:
		print(a + b + c >> 1)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24
from decimal import *
from math import *

def solve():
	(a, b, c) = sep()
	print((a + b + c) // 2)
testcase(int(inp()))


t = int(input())
while t:
	t -= 1
	a = list(map(int, input().split()))
	s = sum(a)
	print(s // 2)


def answer(l):
	for i in range(2, 0, -1):
		bob = l[i]
		alice = l[i - 1]
		diff = bob - alice
		sep = l[i - 2]
		if diff <= sep:
			alice += diff
			sep -= diff
			di = sep // 2
			alice += di
			bob += di
		if alice == bob:
			return bob
T = int(input())
while T > 0:
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	print(answer(l))
	T = T - 1


Q = int(input())
somma = 0
for Q in range(Q):
	(a, b, c) = map(int, input().split())
	somma = a + b + c
	if somma % 2 == 0:
		print(somma // 2)
	else:
		print((somma - 1) // 2)


n_of_queries = int(input())
for i in range(n_of_queries):
	print(sum(map(int, input().split())) // 2)


N = int(input())
for n in range(0, N):
	A = input().split()
	A = map(int, A)
	A = list(A)
	mmm = 0
	for iA in range(0, 3):
		for iB in range(1, 3):
			if iB == 1:
				iC = 2
			if iB == 2:
				iC = 1
			alice = A[iA]
			bob = A[(iA + iB) % 3]
			if bob > alice:
				tmp = alice
				alice = bob
				bob = tmp
			delta = alice - bob
			md = min(delta, A[(iA + iC) % 3])
			bob += md
			r = A[(iA + iC) % 3] - md
			r -= r % 2
			r //= 2
			bob += r
			mmm = max(mmm, bob)
	print(int(mmm))


q = int(input())
for i in range(q):
	k = [int(i) for i in input().split()]
	k.sort()
	if k[0] - k[1] <= k[1] - k[2]:
		ans = k[0] + (k[2] - k[0] + k[1]) // 2
		print(ans)
	else:
		ans = k[1] + (k[0] - k[1] + k[2]) // 2
		print(ans)


for _ in range(int(input())):
	l = sorted(map(int, input().split()))
	a = l[0] + l[2] // 2 + l[2] % 2
	b = l[1] + l[2] // 2
	diff = abs(a - b)
	r = min(a, b) + diff // 2
	print(r)


for p in range(int(input())):
	print(sum(map(int, input().split())) // 2)


n = int(input())
for i in range(n):
	p = list(map(int, input().split()))
	_max = max(p)
	remove_max = p.remove(_max)
	se_max = max(p)
	remove_se_max = p.remove(se_max)
	th_max = p[0]
	if _max == se_max + th_max:
		print(_max)
	elif _max != se_max + th_max:
		c = se_max - th_max
		th_max = th_max + c
		g = _max - c
		d = g // 2
		se_max = se_max + d
		print(se_max)


import sys
input = sys.stdin.readline
q = int(input())
for i in range(q):
	A = [int(i) for i in input().split()]
	print(sum(A) // 2)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
for _ in range(int(input())):
	(a, b, c) = ri()
	print((a + b + c) // 2)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	arr = l()
	out(sum(arr) // 2)


mod = 10 ** 9 + 7
n = int(input())
for _ in range(n):
	a = [int(i) for i in input().split()]
	print(sum(a) // 2)


n = int(input())
while n > 0:
	list1 = list(map(int, input().split()))
	k = list1[0] + list1[1] + list1[2]
	n -= 1
	if k % 2 == 0:
		z = 1
	else:
		k -= 1
	print(k // 2)


a = int(input())
for i in range(a):
	(x, y, z) = map(int, input().split())
	print((x + y + z) // 2)


t = int(input())
for i in range(t):
	candypile = list(map(int, input().split()))
	candypile.sort()
	alice = candypile[0]
	bob = candypile[1]
	x = bob - alice
	if x > 0:
		candypile[2] -= x
		alice += x
	thirdpile = candypile[2]
	if thirdpile == 0:
		print(min(alice, bob))
	elif thirdpile % 2 == 0:
		y = int(thirdpile / 2)
		alice += y
		bob += y
		print(min(alice, bob))
	else:
		y = int((thirdpile + 1) / 2)
		alice += y
		bob += y - 1
		print(min(alice, bob))


import sys
t = int(sys.stdin.readline())
for i in range(t):
	a = list(map(int, sys.stdin.readline().strip().split()))
	op = sum(a)
	print(op // 2)


for i in range(int(input())):
	k = list(map(int, input().split()))
	print(sum(k) >> 1)


q = int(input())
list1 = []
list2 = []
list3 = []
if q >= 1 and q <= 1000:
	for i in range(q):
		(a, b, c) = map(int, input().split(' '))
		list1.append(a)
		list2.append(b)
		list3.append(c)
	for j in range(q):
		sum = 0
		sum = list1[j] + list2[j] + list3[j]
		print(sum // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = list(map(int, input().split()))
	if a < b:
		(a, b) = (b, a)
	if a < c:
		(a, c) = (c, a)
	dif = abs(b - c)
	ans = max(b, c) + (a - dif) // 2
	print(ans)


q = int(input())
s = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	k = (a + b + c) // 2
	s.append(k)
for i in range(q):
	print(s[i])


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	a = list(map(int, stdin.readline().split()))
	print(sum(a) // 2)


T = int(input())
while T > 0:
	arr = list(map(int, input().split()))
	print(sum(arr) // 2)
	T -= 1


for i in range(int(input())):
	print(sum([int(el) for el in input().split()]) // 2)


n = int(input())
for i in range(0, n):
	p = input().rstrip().split(' ')
	S = 0
	S += int(p[0])
	S += int(p[1])
	S += int(p[2])
	print(S // 2)


tests = int(input())
while tests > 0:
	(a, b, c) = [int(i) for i in input().split(' ')]
	minV = min(a, b)
	maxV = max(a, b)
	maxMinDiff = maxV - minV
	if maxMinDiff > c:
		minV = minV + c
		maxMinDiff = maxV - minV
		minV = minV + maxMinDiff // 2
	else:
		cMaxMinDiff = c - maxMinDiff
		c = c - maxMinDiff
		minV = minV + maxMinDiff
		minV = minV + c // 2
	print(minV)
	tests = tests - 1


n = int(input())
res = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	res.append((a + b + c) // 2)
for e in res:
	print(e)


import sys
inf = sys.stdin
lines = inf.readlines()
q = int(lines[0])
for tests in range(q):
	candy = [int(val) for val in lines[tests + 1].split()]
	total = candy[0] + candy[1] + candy[2]
	print(total // 2)


a = int(input())
for i in range(0, a):
	b = list(map(int, input().split()))
	b.append(9898989888898)
	b[3] = (b[0] + b[1] + b[2]) // 2
	print(b[3])


import sys
len_of_spisok = int(input())
for i in range(int(len_of_spisok)):
	(a, b, c) = input().split(' ')
	print('{}'.format((int(a) + int(b) + int(c)) // 2))


q = int(input())
for _ in range(q):
	l = sorted(map(int, input().split()))
	print((l[-1] - (l[1] - l[0])) // 2 + l[1])


for i in range(int(input())):
	(s1, s2, s3) = map(int, input().split())
	s = s1 + s2 + s3
	print(s // 2)


def candyPile(a, b, c):
	overall = a + b + c
	while overall % 2 != 0:
		overall -= 1
	return overall // 2
t = int(input())
ans = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	ans.append(candyPile(a, b, c))
for i in ans:
	print(i)


q = int(input())
for _ in range(q):
	p = list(map(int, input().rstrip().split()))
	print(sum(p) // 2)


n = int(input())
for k in range(n):
	w = list(map(int, input().split()))
	d = sum(w) // 2
	print(d)


def split(piles):
	return sum(piles) // 2
n = int(input().rstrip())
for _ in range(n):
	piles = list(map(int, input().rstrip().split()))
	alice = split(piles)
	print(alice)


T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().strip().split())
	d = c - b
	e = b - a
	if d > e:
		pile3 = c
		pile1 = max(a, b)
		pile2 = min(a, b)
	else:
		pile3 = a
		pile1 = max(b, c)
		pile2 = min(b, c)
	difference = pile1 - pile2
	pile3 = pile3 - difference
	pile2 = pile2 + difference
	pile1 = pile1 + pile3 // 2
	pile2 = pile2 + pile3 // 2
	print(pile1)


def thr(li):
	k = sum(li)
	ans = k // 2
	print(ans)
t = int(input())
for i in range(t):
	li = [int(i) for i in input().split()]
	ans = thr(li)
	ans


n = int(input())
q = []
for _ in range(n):
	q.append([int(x) for x in input().split()])
for query in q:
	print(sum(query) // 2)


z = input
from math import ceil
n = int(z())
for i in range(n):
	l = sum(list(map(int, z().split())))
	print(l // 2)


def main():
	import sys
	input = sys.stdin.readline

	def solve():
		(a, b, c) = sorted(list(map(int, input().split())))
		c -= b - a
		a = b
		print(b + c // 2)
	for _ in range(int(input())):
		solve()
	return 0
main()


q = int(input())
r = []
for i in range(q):
	a = []
	a = list(map(int, input().split()))
	r.append(sum(a) // 2)
print(*r, sep='\n')


num = int(input())
f = 0
s = 0
for i in range(num):
	ara = list(map(lambda x: int(x), input().split()))
	ara.sort()
	f = ara[0]
	s = ara[1]
	if f > s:
		if f - s < ara[2]:
			ara[2] -= f - s
			s += f - s
			if ara[2] % 2 == 0:
				f += ara[2] // 2
				s += ara[2] // 2
			else:
				f += (ara[2] - 1) // 2
				s += (ara[2] - 1) // 2
		else:
			s += ara[2]
			f -= f - s
	elif s > f:
		if s - f < ara[2]:
			ara[2] -= s - f
			f += s - f
			if ara[2] % 2 == 0:
				f += ara[2] // 2
				s += ara[2] // 2
			else:
				f += (ara[2] - 1) // 2
				s += (ara[2] - 1) // 2
		else:
			f += ara[2]
			s -= s - f
	elif f == s:
		if ara[2] % 2 == 0:
			f += ara[2] // 2
			s += ara[2] // 2
		else:
			f += (ara[2] - 1) // 2
			s += (ara[2] - 1) // 2
	print(f)


n = int(input())
for iter1 in range(n):
	N = list(map(int, input().split()))
	N.sort(reverse=True)
	Alice = 0
	Bob = 0
	while len(N) > 1:
		n = N.pop()
		if Alice < Bob:
			Alice += n
		else:
			Bob += n
	if N[0] <= abs(Alice - Bob):
		if Alice < Bob:
			Alice += N[0]
		else:
			Bob += N[0]
	else:
		tmp = (N[0] - abs(Alice - Bob)) // 2
		if Alice < Bob:
			Alice += abs(Alice - Bob) + tmp
			Bob += tmp
		else:
			Bob += abs(Alice - Bob) + tmp
			Alice += tmp
	print(min(Alice, Bob))


def candies(q):
	s = sum(arr)
	s = s // 2
	return s
q = int(input())
for _ in range(q):
	arr = list(map(int, input().strip().split()))
	print(candies(arr))


def fair(a, b, c):
	if a > b:
		x = a
		a = b
		b = x
	if c + a < b:
		return c + a
	return b + (c - (b - a)) // 2
q = int(input())
for _ in range(q):
	x = input().split()
	x = [int(t) for t in x]
	a = x[0]
	b = x[1]
	c = x[2]
	ans = 0
	ans = max(ans, fair(a, b, c))
	ans = max(ans, fair(a, c, b))
	ans = max(ans, fair(b, c, a))
	print(ans)


q = int(input())
while q > 0:
	q -= 1
	l = sorted([int(x) for x in input().split()])
	total = sum(l)
	goal = total // 2
	if l[0] + l[1] >= l[2]:
		a = l[0]
		b = l[2]
		print(goal)
	else:
		a = l[1]
		b = l[2]
		print(goal)


t = int(input())
for i in range(t):
	arr = list(map(int, input().split()))
	if sum(arr) % 2 == 1:
		print((sum(arr) - 1) // 2)
	else:
		print(sum(arr) // 2)


import math
import sys
from collections import *
from bisect import bisect_left, bisect_right

def cint():
	return list(map(int, sys.stdin.readline().strip().split()))

def cstr():
	return list(map(str, input().split(' ')))

def solve():
	(a, b, c) = cint()
	if (a + b + c) % 2 == 0:
		print((a + b + c) // 2)
	else:
		print((a + b + c - 1) // 2)
t = int(input())
while t != 0:
	solve()
	t -= 1


import decimal
D = decimal.Decimal

def answer():
	n = int(input())
	c_out = []
	while n:
		a = [D(x) for x in input().split()]
		ans = D(sum(a))
		if ans % 2:
			ans = D(sum(a) - 1)
		c_out.append(D(ans / 2))
		n -= 1
	for x in c_out:
		print(x)
answer()


for q in range(int(input())):
	l = [*map(int, input().split())]
	res = 0
	for i in range(3):
		for j in range(i + 1, 3):
			(a, b, c) = (l[i], l[j], l[6 - (i + 1) - (j + 1) - 1])
			if a < b:
				if b - a <= c:
					tmp = b - a
					a += tmp
					c -= tmp
				else:
					a += c
					c = 0
			elif a > b:
				if a - b <= c:
					tmp = a - b
					b += tmp
					c -= tmp
				else:
					b += c
					c = 0
			c1 = c // 2
			c2 = c - c // 2
			a += c1
			b += c2
			res = max(res, min(a, b))
	print(res)


q = int(input())
queries = [sum(map(lambda x: int(x), input().split())) // 2 for _ in range(q)]
for query in queries:
	print(query)


no = int(input())
main = []
for i in range(no):
	x = list(map(int, input().split()))
	x = sum(x)
	main.append(x // 2)
for i in main:
	print(i)


lists = int(input())
for i in range(1, lists + 1):
	numbers = input().split(' ')
	total = int(numbers[0]) + int(numbers[1]) + int(numbers[2])
	print(total // 2)


def sp():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	l = list(sp())
	l.sort()
	a = l[0]
	b = l[1]
	c = (abs(a - b) + l[2]) // 2
	a += c
	b += l[2] - c
	print(int(min(a, b)))


for _ in range(int(input())):
	lst = [int(i) for i in input().split()]
	sum = 0
	for i in lst:
		sum = sum + i
	print(sum // 2)


for i in range(int(input())):
	print(sum([int(j) for j in input().split()]) // 2)


t = int(input())
ans = 0
for _ in range(t):
	s = sorted(list(map(int, input().split())))
	print((s[2] - (s[1] - s[0])) // 2 + s[1])


import math
from sys import stdin, stdout

def distribute_candy(list_el) -> int:
	if len(list_el) == 1:
		return ''
	elif len(list_el) == 0:
		return ''
	sum_of_list = sum(list_el) if sum(list_el) % 2 == 0 else sum(list_el) - 1
	divided_by_2 = sum_of_list // 2
	return divided_by_2
msg = stdin.readlines()
for item in msg:
	optimal_num = distribute_candy([int(x) for x in item.split()])
	stdout.write(str(optimal_num) + '\n')


from copy import deepcopy
from bisect import bisect_right
from itertools import combinations
from sys import stdin

def dis(first, second, remain):
	if second[0] > first[0]:
		(first[0], second[0]) = (second[0], first[0])
	if remain > first[0] - second[0]:
		remain -= first[0] - second[0]
		second[0] = first[0]
		first[0] += remain // 2
		return first[0]
	else:
		return second[0] + remain
q = int(stdin.readline().strip())
for _ in range(q):
	(f, s, t) = list(map(int, stdin.readline().split()))
	ans = -float('inf')
	a = [f]
	b = [s]
	ans = max(ans, dis(a, b, t))
	a = [s]
	b = [t]
	ans = max(ans, dis(a, b, f))
	a = [f]
	b = [t]
	ans = max(ans, dis(a, b, s))
	print(ans)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
for _ in range(int(f_input())):
	three_piles = sorted([int(z) for z in f_input().split()])
	(Alice, Bob) = (three_piles[1], three_piles[1])
	three_piles[2] -= three_piles[1] - three_piles[0]
	Alice = (Alice + Bob + three_piles[2]) // 2
	f_print(str(int(Alice)) + '\n')


n = int(input())
for i in range(0, n):
	result = [int(i) for i in input().split()]
	print(int(sum(result) // 2))


import itertools

def input_ints():
	return list(map(int, input().split()))

def output_list(v):
	print(' '.join((str(x) for x in v)))

def main():
	q = int(input())
	for _ in range(q):
		print(sum(input_ints()) // 2)
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		a = LI()
		rr.append(sum(a) // 2)
	return JA(rr, '\n')
print(main())


q = int(input())
result = ''
while q > 0:
	candies = input()
	candies = candies.split()
	total = 0
	for i in candies:
		total += int(i)
	result += str(total // 2)
	result += '\n'
	q -= 1
print(result)


def main():
	queries = int(input())
	for i in range(queries):
		(pile1, pile2, pile3) = input().split()
		piles = (int(pile1), int(pile2), int(pile3))
		(alicePile, bobPile, remainder) = (piles[0], piles[1], piles[2])
		alicePile += remainder
		remainder = 0
		while alicePile != bobPile:
			if alicePile > bobPile:
				alicePile += 1

def easy():
	queries = int(input())
	for i in range(queries):
		(pile1, pile2, pile3) = input().split()
		print(str((int(pile1) + int(pile2) + int(pile3)) // 2))
easy()


q = int(input())
for _ in range(q):
	List = list(map(int, input().split()))
	print(sum(List) // 2)


q = int(input())
for i in range(q):
	a = sorted(list(map(int, input().split())))
	if a[1] - a[0] >= a[2]:
		print(a[0] + a[2])
	else:
		s = int((a[2] - (a[1] - a[0])) / 2)
		print(min(a[1] + s, a[1] + a[2] - (a[1] - a[0]) - s))


q = int(input())
array = []
for i in range(q):
	jlh = 0
	x = [int(i) for i in input().split()]
	for i in range(3):
		jlh += x[i]
	array += [jlh // 2]
for i in array:
	print(i)


riga = input()
query = int(riga)
for i in range(query):
	riga = input()
	test = riga.split()
	numeri = [0, 0, 0]
	for j in range(3):
		numeri[j] = int(test[j])
	numeri.sort()
	numeri[2] = numeri[2] - (numeri[1] - numeri[0])
	risultato = numeri[1] + numeri[2] // 2
	print(risultato)


import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	ans = (a + b + c) // 2
	print(ans)


A = []
T = int(input())
for i in range(T):
	A.append((int(x) for x in input().split()))
for X in A:
	print(sum(X) // 2)


for tc in range(0, int(input())):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


for i in range(int(input())):
	(b, c, d) = map(int, input().split())
	su = b + c + d
	print((su - su % 2) // 2)


from math import sqrt

def main():
	n = int(input())
	for i in range(n):
		(a, b, c) = [int(v) for v in input().split()]
		print((a + b + c) // 2 if (a + b + c) % 2 == 0 else (a + b + c - 1) // 2)
main()


t = int(input())
for _ in range(t):
	a = sorted(map(int, input().split()))
	s = sum(a)
	print(s // 2)


exec(int(input()) * 'print(sum(map(int, input().split())) // 2);')


q = int(input())
for _ in range(q):
	a = list(map(int, input().split()))
	s = sum(a)
	print(s // 2)


q = int(input().strip())
for _ in range(q):
	total = sum([int(x) for x in input().split(' ')])
	(div, mod) = divmod(total, 2)
	print(div)


n = int(input())
for i in range(n):
	candies = sum(map(int, input().split()))
	if candies % 2 == 0:
		print(int(candies // 2))
	else:
		print(int((candies - 1) // 2))


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
t = int(input())
for y in range(t):
	l = list(map(int, input().split()))
	ans = sum(l) // 2
	print(ans)


q = int(input())
for _ in range(q):
	(A, B, C) = map(int, input().split())
	print((A + B + C) // 2)


t = int(input())
for i in range(0, t):
	(a, b, c) = map(int, input().strip().split(' '))
	sum = a + b + c
	if sum % 2 == 0:
		print(sum // 2)
	else:
		print(sum // 2)


t = int(input())
store = []
for i in range(t):
	x = list(map(int, input().split()))
	store.append(x)
for i in range(t):
	print(sum(store[i]) // 2)


t = int(input())
for i in range(t):
	c = [int(n) for n in input().split()]
	res = sum(c) // 2
	print(res)


is_debug = False
q = int(input())
for _ in range(q):
	print(f'{sum(map(int, input().split())) // 2}')


q = int(input())
for _ in range(q):
	l1 = list()
	l = list(map(int, input().split()))
	for i in range(3):
		for j in range(i + 1, 3):
			temp = (l[3 - i - j] + l[i] + l[j]) // 2
			l1.append(temp)
	print(max(l1))


t = int(input())
for tc in range(t):
	l = list(map(int, input().split(' ')))
	l.sort()
	(a, b, s) = l
	k = b - a
	if s - k >= 0:
		a = a + k
		s = s - k
		k = s // 2
		a = a + k
		b = b + k
		print(a)
	else:
		print(a)


x = int(input())
for i in range(x):
	y = list(map(int, input().split()))
	s = y[1] + y[0] + y[2]
	print(s // 2)


k = int(input())
l = []
ll = []
for a in range(k):
	s = input()
	l = s.split()
	x = (int(l[0]) + int(l[1]) + int(l[2])) // 2
	ll.append(x)
for b in ll:
	print(b)


cases = int(input())
for i in range(0, cases):
	candies = input().split(' ')
	total = 0
	for x in candies:
		total = total + int(x)
	print(total // 2)


def main():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		print(b + (c - (b - a)) // 2)
main()


t = int(input())
for i in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	ans = (a + b + c) // 2
	print(ans)


def divide_candles():
	return (a + b + c) // 2
q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	print(divide_candles())


n = int(input())
l = []
for i in range(n):
	x = list(map(int, input().split()))
	y = sum(x)
	sol = y // 2
	l.append(sol)
for i in range(n):
	print(l[i])


n = int(input())
final = [0] * n
pos = 0
for i in range(n):
	values = input().split()
	count = 0
	for i in values:
		count += int(i)
	final[pos] = count // 2
	pos += 1
for i in final:
	print(str(i))


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	t = inin()
	for _ in range(t):
		a = ain()
		a.sort()
		j = a[0]
		k = a[1]
		l = a[2]
		x = k - j
		j = j + min(x, l)
		l -= x
		if l < 0:
			l = 0
		print(j + l // 2)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


i = 0
q = int(input())
for i in range(0, q):
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	a = (x + y + z) // 2
	print(a)


import math
n = int(input())
Result = []
for i in range(0, n):
	List = list(map(int, input().strip().split()))[0:3]
	List.sort()
	a = List[0]
	b = List[1]
	c = List[2]
	delta = b - a
	xFloor = math.floor((c - delta) / 2)
	a_ = a + (c - xFloor)
	b_ = b + xFloor
	low = a_
	if b_ < a_:
		low = b_
	Result.append(low)
for i in Result:
	print(i)


import math
t = int(input())
list1 = []
for z in range(t):
	a = [int(i) for i in input().split()]
	alice = 0
	bob = 0
	if a[0] + a[1] == a[2]:
		print(a[2])
	elif a[1] + a[2] == a[0]:
		print(a[0])
	elif a[2] + a[0] == a[1]:
		print(a[1])
	else:
		mi = min(a)
		ma = max(a)
		s = sum(a) - ma - mi
		alice += s
		bob += mi
		if ma % 2 == 0:
			alice += ma // 2
			bob += ma // 2
		else:
			alice += ma // 2 + 1
			bob += ma // 2
		while alice != bob:
			diff = alice - bob
			if diff % 2 == 0:
				alice -= diff // 2
			else:
				alice -= diff // 2 + 1
			bob += diff // 2
			diff = alice - bob
			if diff == 1:
				alice -= 1
				break
		print(alice)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Prime_factors(n):
	i = 2
	factors = set()
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.add(i)
	if n > 1:
		factors.add(n)
	print(factors)
	if len(factors) == 2:
		return True
	else:
		return False

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def Sieve(n):
	prime = [True for i in range(n + 1)]
	lst = []
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p = p + 1
	for i in range(2, n + 1):
		if prime[i]:
			lst.append(i)
	return lst

def minimum_integer_not_in_list(a):
	b = max(a)
	if b < 1:
		return 1
	A = set(a)
	B = set(range(1, b + 1))
	D = B - A
	if len(D) == 0:
		return b + 1
	else:
		return min(D)

def solution():
	for _ in range(Int()):
		a = List()
		print(sum(a) // 2)
solution()


for _ in range(int(input().strip())):
	(a, b, c) = list(map(int, input().split()))
	total = a + b + c
	ans = total // 2
	print(ans)


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	(bob, al) = (0, 0)
	sweets = [a, b, c]
	sweets.sort()
	bob += sweets[0]
	al += sweets[1]
	const = min(al - bob, sweets[2])
	bob += const
	sweets[2] -= const
	al += sweets[2] // 2
	bob += sweets[2] - sweets[2] // 2
	print(min(al, bob))


t = int(input())
output = []
for i in range(t):
	p = list(map(int, input().split()))
	p.sort()
	alice = p[1]
	bob = p[0]
	diff = alice - bob
	bob += diff
	p[2] -= diff
	diff = p[2] // 2
	alice += diff
	output.append(alice)
for i in output:
	print(i)


t = int(input())
for test in range(t):
	l = list(map(int, input().split()))
	m1 = 0
	for i in range(3):
		if l[i] > l[m1]:
			m1 = i
	m2 = 0
	if m2 == m1:
		m2 = 1
	for i in range(3):
		if l[m2] < l[i] and i != m1:
			m2 = i
	list0 = [m2, m1]
	m3 = 0
	for i in range(3):
		if i != m1 and i != m2:
			m3 = i
	diff = l[m1] - l[m2]
	if diff < l[m3]:
		l[m3] -= diff
		print(l[m1] + l[m3] // 2)
	else:
		diff1 = l[m2] - l[m3]
		l[m1] -= diff1
		print(l[m2] + l[m1] // 2)


t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	import math
	ans = math.floor(sum(arr) // 2)
	print(ans)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = list(map(int, input().split()))
	ans = (a + b + c) // 2
	print(ans)


q = int(input())
for i in range(q):
	p = list(map(int, input().split()))
	p.sort()
	m = p[0]
	n = p[1]
	o = p[2]
	x = (m - n + o) // 2
	y = (-m + n + o) // 2
	print(n + x)


q = int(input())
a = [0, 0, 0]
for i in range(q):
	str = input()
	a = str.split(' ')
	a = [int(e) for e in a]
	delta = max(a)
	l = 0
	if abs(a[0] - a[2]) < delta:
		a[1] = a[2] + a[1]
		a[2] = a[1] - a[2]
		a[1] = a[1] - a[2]
	if abs(a[1] - a[2]) < delta:
		a[0] = a[2] + a[0]
		a[2] = a[0] - a[2]
		a[0] = a[0] - a[2]
	if a[0] > a[1]:
		a[0] = a[1] + a[0]
		a[1] = a[0] - a[1]
		a[0] = a[0] - a[1]
	l = abs(a[0] - a[1])
	d = (a[2] - l) // 2
	a[0] += d + l
	a[1] += d
	print(a[0])


Q = int(input())
for q in range(Q):
	(a, b, c) = list(map(int, input().split()))
	s = a + b + c
	if s % 2 == 0:
		print(s // 2)
	else:
		s = s - 1
		print(s // 2)


import math
q_count = int(input())
for i in range(q_count):
	nums = input().split(' ')
	piles_fair = sum(map(lambda x: int(x), nums)) // 2
	print(piles_fair)


q = int(input())
for _ in range(q):
	s = [int(x) for x in input().split(' ')]
	s.sort()
	b = s[2]
	a = s[1] + s[0]
	a += (b - a) // 2
	print(a)


q = int(input())
for i in range(0, q):
	nums = input().split()
	nums = sorted(map(int, nums))
	print(int((nums[0] + nums[1] + nums[2]) // 2))


q = int(input())
for l in range(q):
	arr = list(map(int, input().split()))
	ans = 0
	if arr[0] > arr[1] + arr[2]:
		ans = max(ans, arr[1] + arr[2])
	else:
		ans = max(ans, (arr[0] + arr[1] + arr[2]) // 2)
	if arr[1] > arr[0] + arr[2]:
		ans = max(ans, arr[0] + arr[2])
	else:
		ans = max(ans, (arr[0] + arr[1] + arr[2]) // 2)
	if arr[2] > arr[0] + arr[1]:
		ans = max(ans, arr[0] + arr[1])
	else:
		ans = max(ans, (arr[0] + arr[1] + arr[2]) // 2)
	print(ans)


n = int(input())
while n > 0:
	a = list(map(int, input().split()))
	s = sum(a)
	print(s // 2)
	n -= 1


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	(a, b, c) = arrIN()
	print((a + b + c) // 2)


a = int(input())
for i in range(a):
	(z, x, c) = map(int, input().split())
	s = z + x + c
	s = s // 2
	print(s)


import math as m
for tc in [0] * int(input()):
	s = list(map(int, input().split()))
	print(sum(s) // 2)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	alice = bob = sum(l) // 2
	print(alice)


import math
s = int(input())
t = 0
l = []
for i in range(s):
	k = input().split(' ')
	for j in range(len(k)):
		t = t + int(k[j])
	l.append(t // 2)
	t = 0
for b in range(len(l)):
	print(int(l[b]))


T = int(input())
for n in range(T):
	tot = 0
	(C1, C2, C3) = map(int, input().split())
	tot = C1 + C2 + C3
	if tot % 2 == 0:
		tot = tot // 2
	else:
		tot = (tot - 1) // 2
	print(tot)


N = int(input())
l = []
for i in range(N):
	(a, b, c) = map(int, input().split())
	sum = a + b + c
	d = sum // 2
	l.append(d)
for i in range(N):
	print(l[i])


n = int(input())
for i in range(n):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	c = int(s[2])
	if a > b:
		(a, b) = (b, a)
	if b > c:
		(b, c) = (c, b)
	if a > b:
		(a, b) = (b, a)
	dif = b - a
	if dif >= c:
		print(a + c)
	else:
		print(b + (c - dif) // 2)


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	total = a + b + c
	each = total // 2
	print(each)


q = int(input())
for query in range(q):
	piles = input()
	piles = [int(x) for x in piles.split()]
	print(sum(piles) // 2)


x = int(input())
while x:
	print(sum(list(map(int, input().split()))) // 2)
	x -= 1


q = int(input())
for Q in range(q):
	A = [int(i) for i in input().split()]
	A.sort()
	alice = A[0]
	bob = A[1]
	excess = A[2]
	total = sum(A)
	each = total // 2
	print(each)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	sum1 = sum(l)
	if sum1 % 2 == 0:
		print(sum1 // 2)
	else:
		print((sum1 - 1) // 2)


for i in [0] * int(input()):
	l = sorted(list(map(int, input().split())))
	f = l[2] - (l[1] - l[0])
	print(f // 2 + l[1])


inp = lambda cast=int: list(map(cast, input().split()))
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
(t,) = inp()
for _ in range(t):
	print(sum(sorted(inp())) // 2)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l.sort()
	(a, b, c) = (l[0], l[1], l[2])
	c1 = (c + b - a) // 2 + a
	c2 = (a + b - c) // 2 + c
	c3 = (a + c - b) // 2 + b
	print(max(c1, c2, c3))


num_inputs = int(input())
for i in range(num_inputs):
	pile = input()
	pilelist = pile.split()
	total = int(pilelist[0]) + int(pilelist[1]) + int(pilelist[2])
	print(total // 2)


t = int(input())
for _ in range(0, t):
	l = list(map(int, input().split(' ')))
	a = sum(l)
	print(a // 2)


for x in range(int(input())):
	ls = list(map(int, input().split()))
	print(sum(ls) // 2)


x = int(input())
for i in range(x):
	l = list(map(int, input().split()))
	print(sum(l) // 2)


import math
q = int(input())
for j in range(q):
	arr = [int(i) for i in input().split()]
	print(sum(arr) // 2)


q = int(input())
for q1 in range(q):
	ar = list(map(int, input().split()))
	ar.sort()
	a = ar[0]
	b = ar[1]
	c = ar[2]
	al = a
	bo = b
	al += b - a
	c -= b - a
	al += c // 2
	print(al)


n = int(input())
for i in range(n):
	p = sum([int(x) for x in input().split()])
	if p % 2 == 0:
		print(p // 2)
	else:
		print((p - 1) // 2)


t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	tot = sum(arr)
	print(tot // 2)


for _ in range(int(input())):
	li = list(map(int, input().split()))
	li = sorted(li)
	print((li[0] + li[1] + li[2]) // 2)


q = int(input())
for _ in range(q):
	a = [int(x) for x in input().split()]
	a.sort()
	x = a[0]
	y = a[1]
	k = y - x
	z = a[2]
	z -= k
	z //= 2
	y += z
	print(y)


def go(x, y, z):
	if x > y:
		(x, y) = (y, x)
	d = min(z, y - x)
	x += d
	z -= d
	d = z // 2
	x += z - d
	y += d
	return min(x, y)
for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	print(max(go(x, y, z), go(x, z, y), go(y, z, x)))


from math import *
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split(' '))
	sum = a + b + c
	print(sum // 2)


queries = int(input())
for i in range(queries):
	(a, b, c) = map(int, input().split())
	answer = (a + b + c) // 2
	print(answer)


n = int(input())
(a, b, c) = ([], [], [])
for i in range(n):
	(a1, b1, c1) = map(int, input().split())
	a.append(a1)
	b.append(b1)
	c.append(c1)
for i in range(n):
	value = a[i] + b[i] + c[i]
	print(value // 2)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	(n, k, s) = map(int, sys.stdin.readline().split(' '))
	s = n + k + s
	print(s // 2)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


[print(sum(map(int, input().split())) // 2) for i in '.' * int(input())]


q = int(input())
for i in range(q):
	x = list(map(int, input().rstrip().split()))
	val = x[0] + x[1] + x[2]
	print(val // 2)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	summ = a + b + c
	sol = summ // 2
	print(sol)


q = int(input())
for t in range(q):
	(a, b, c) = map(int, input().split())
	d = [a, b, c]
	d.sort()
	x = d[0]
	y = d[1]
	c = d[2]
	if x + c <= y:
		print(x + c)
	else:
		print(int((x + y + c) // 2))


q = int(input())
while q:
	q = q - 1
	l = list(map(int, input().split()))
	l.sort()
	print(l[0] + (l[1] + l[2] - l[0]) // 2)


q = int(input())
for i in range(q):
	hs = list(map(int, input().split()))
	hs.sort()
	a = hs[0]
	b = hs[1]
	c = hs[2]
	d = b - a
	a += d
	c -= d
	a += c // 2
	print(a)


x = []
for i in range(int(input())):
	arr = list(map(int, input().split()))
	x.append(sum(arr) // 2)
for elm in x:
	print(elm)


n = int(input())
for i in range(n):
	val = list(map(int, input().split()))
	val.sort()
	val[2] -= val[1] - val[0]
	print(val[1] + val[2] // 2)


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	l = li()
	pr(sum(l) // 2)
for _ in range(inp()):
	solve()


for _ in range(int(input())):
	v = list(map(int, input().split()))
	v.sort()
	if v[0] + v[1] == v[2]:
		print(v[2])
	elif v[2] % 2 == 0:
		x = v[0] + v[2] // 2
		y = v[1] + v[2] // 2
		if abs(x - y) % 2 == 1:
			diff = (abs(x - y) - 1) // 2
			print(x + diff)
		else:
			diff = abs(x - y) // 2
			print(x + diff)
	else:
		v[2] -= 1
		x = v[0] + v[2] // 2
		y = v[1] + v[2] // 2
		if abs(x - y) % 2 == 1:
			diff = (abs(x - y) + 1) // 2
			print(x + diff)
		else:
			diff = abs(x - y) // 2
			print(x + diff)


t = int(input())
while t:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	ans = (a + b + c) // 2
	print(ans)
	t = t - 1


from math import *
t = int(input())
while t > 0:
	t -= 1
	a = [int(x) for x in input().split()]
	a.sort(reverse=True)
	alice = 0
	bob = 0
	r = 0
	if a[0] - a[1] > a[1] - a[2]:
		alice += a[1]
		bob += a[2]
		r = a[0]
	else:
		alice += a[0]
		bob += a[1]
		r = a[2]
	if r % 2 != 0:
		if alice > bob:
			bob += 1
		else:
			alice += 1
	pola = alice
	alice = alice + r // 2 - (alice - bob) // 2
	bob = bob + r // 2 + (pola - bob) // 2
	h = min(alice, bob)
	print(h)


n = int(input())
for i in range(0, n):
	sum = 0
	data = list(map(int, input().split()))
	for j in data:
		sum += j
	print(sum // 2)


t = int(input())
for r in range(t):
	(a, b, c) = input().split(' ')
	(a, b, c) = (int(a), int(b), int(c))
	s = a + b + c
	ans = s // 2
	print(ans)


n = int(input())
for z in range(0, n):
	sum = 0
	piles = input().split(' ')
	for p in piles:
		sum += int(p)
	print(sum // 2)


q = int(input())
for _ in range(q):
	candies = list(map(int, input().rstrip().split()))
	s = candies[0] + candies[1] + candies[2]
	print(s // 2)


num = int(input())
answ = []
for x in range(0, num):
	arr = input().split(' ')
	num1 = int(arr[0])
	num2 = int(arr[1])
	num3 = int(arr[2])
	answ.append(int((num1 + num2 + num3) // 2))
for x in range(0, num):
	print(answ[x])


def max_candies(a):
	a.sort()
	diff = 0
	if a[0] is not a[1]:
		diff = a[1] - a[0]
		a[0] += diff
	a[2] -= diff
	if a[2] % 2 == 0:
		a[0] += a[2] // 2
		a[1] += a[2] // 2
	else:
		if a[2] is 1:
			return a[0]
		l = (a[2] - 1) // 2
		a[0] += l
		a[1] += l
	return a[0]
q = int(input())
o = []
for _ in range(0, q):
	p = input()
	o.append(max_candies([int(x) for x in p.split(' ')]))
for i in o:
	print(i)


n = int(input())
for i in range(n):
	(a, b, c) = sorted(map(int, input().split()))
	r = min(b - a, c - b)
	if c >= b - a:
		print(b + (c - b + a) // 2)
	elif a >= c - b:
		print(c + (a - c + b) // 2)
	else:
		print(a + b)


a = int(input())
b = list()
r = 0
while r < a:
	c = [int(c) for c in input().split()]
	b.append(sum(c) // 2)
	r = r + 1
r = 0
while r < len(b):
	print(b[r])
	r = r + 1


q = int(input())
for i in range(q):
	numbers = list(map(int, input().split()))
	my_sum = sum(numbers) // 2
	print(my_sum)


def abs(x):
	if x < 0:
		return -x
	else:
		return x
t = int(input())
for x in range(t):
	(a, b, c) = map(int, input().split())
	(d, e, f) = (abs(a - b), abs(a - c), abs(b - c))
	switch = 0
	if d < e:
		if d < f:
			switch = 1
		else:
			switch = 2
	elif e < f:
		switch = 3
	else:
		switch = 2
	if switch == 1:
		if a > b:
			b += d
			c -= d
			b += c // 2
			print(b)
			continue
		else:
			a += d
			c -= d
			a += c // 2
			print(a)
			continue
	elif switch == 2:
		if c > b:
			b += f
			a -= f
			b += a // 2
			print(b)
			continue
		else:
			c += f
			a -= f
			c += a // 2
			print(c)
			continue
	elif a > c:
		c += e
		b -= e
		c += b // 2
		print(c)
		continue
	else:
		a += e
		b -= e
		a += b // 2
		print(a)
		continue


t = int(input())
for i in range(t):
	a = input().split(' ')
	a = [int(n) for n in a]
	b = sum(a)
	print(b // 2)


def main():
	import sys
	input = sys.stdin.readline
	q = int(input())
	for _ in range(q):
		print(sum(map(int, input().split())) // 2)
main()


for z in range(int(input())):
	a = list(map(int, input().split()))
	print(sum(a) // 2)


for _ in range(int(input())):
	a = tuple(map(int, input().split()))
	print(min(sum(a) // 2, sum(a) - min(a)))


from sys import stdin, stdout
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warmup = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7
import sys

class merge_find:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def primeFactors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def isprime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warmup
	if fac_warmup:
		return
	factorial_modP = [1 for _ in range(fac_warmup_size + 1)]
	for i in range(2, fac_warmup_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warmup = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warmup, factorial_modP
	if not fac_warmup:
		warm_up_fac(MOD)
		fac_warmup = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
import heapq, itertools
pq = []
entry_finder = {}
REMOVED = '<removed-task>'

def add_task(task, priority=0):
	if task in entry_finder:
		remove_task(task)
	count = next(counter)
	entry = [priority, count, task]
	entry_finder[task] = entry
	heapq.heappush(pq, entry)

def remove_task(task):
	entry = entry_finder.pop(task)
	entry[-1] = REMOVED

def pop_task():
	while pq:
		(priority, count, task) = heapq.heappop(pq)
		if task is not REMOVED:
			del entry_finder[task]
			return task
	raise KeyError('pop from an empty priority queue')
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_serach(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = True
testingMode = False
fac_warmup_size = 10 ** 5 + 100
optimiseForReccursion = False
from math import factorial

def main():
	li = get_list()
	print(sum(li) // 2)
if TestCases:
	for i in range(get_int()):
		cProfile.run('main()') if testingMode else main()
else:
	(cProfile.run('main()') if testingMode else main()) if not optimiseForReccursion else threading.Thread(target=main).start()


q = int(input())
for _ in range(q):
	abc = [int(x) for x in input().split(' ')]
	bfarr = []
	for _ in range(len(abc)):
		ans = 0
		(a, b, c) = abc
		while c > 0:
			stub = 1
			if a == b:
				a += c // 2
				b += c // 2
				c = 0
			else:
				stub = min(abs(a - b), c)
			if a <= b:
				a += stub
			else:
				b += stub
			c -= stub
		bfarr.append(min(a, b))
		abc.append(abc.pop(0))
	print(max(bfarr))


queries = int(input())
piles = []
for i in range(0, queries):
	pile = list(map(int, input().split()))
	piles.append(pile)
empty = []
counter = 0
for element in piles:
	for val in element:
		counter += val
	empty.append(counter)
	counter = 0
alice = []
for i in empty:
	x = i // 2
	alice.append(x)
for val in alice:
	print(val)


import sys
from collections import defaultdict
input = sys.stdin.readline

def optim(x, y, z):
	if z >= abs(x - y):
		return (x + y + z) // 2
	else:
		return min(x, y) + z

def main():
	q = int(input())
	for _ in range(q):
		(a, b, c) = map(int, input().split())
		print(max(optim(a, b, c), optim(a, c, b), optim(b, a, c), optim(b, c, a), optim(c, a, b), optim(c, b, a)))
main()


from sys import stdin
input = stdin.readline
for i in range(int(input())):
	l = list(map(int, input().split()))
	print(sum(l) // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	if s % 2 == 0:
		print(s // 2)
	else:
		print(s // 2)


output = []
for i in range(int(input())):
	sum = 0
	inputs = input().split(' ')
	for j in range(len(inputs)):
		sum += int(inputs[j])
	sum //= 2
	output.append(sum)
for i in range(len(output)):
	print(output[i])


import sys
try:
	sys.stdin = open('inp.txt', 'r')
except:
	pass

def helper():
	pass
t = int(input())
for _ in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	s = (a + b + c) // 2
	print(s)


x = int(input())
y = []
z = []
for c in range(x):
	y.append(input().split())
for v in y:
	print((int(v[0]) + int(v[1]) + int(v[2])) // 2)


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	arr.sort()
	num = arr[2] - (arr[1] - arr[0])
	print(num // 2 + arr[1])


for i in range(int(input())):
	summ = 0
	inp = [int(i) for i in input().split()]
	summ += sum(inp)
	print(summ // 2)


q = int(input())

def solve():
	(a, b, c) = [int(x) for x in input().split()]
	return (a + b + c) // 2
for _ in range(q):
	print(solve())


t = int(input())
q = []
for i in range(t):
	l = list(input().split())
	a = []
	for j in range(3):
		a.append(int(l[j]))
	q.append(sum(a) // 2)
for i in q:
	print(i)


def max_candy(p):
	return sum(p) // 2
q = int(input())
for i in range(q):
	p = list(map(int, input().split()))
	print(max_candy(p))


T = int(input())
for i in range(T):
	row = input()
	s = 0
	for x in map(int, row.split(' ')):
		s += x
	print(s // 2)


def solve(a, b, c):
	c1 = (b + c - a) // 2
	x = a + c1
	y = b + (c - c1)
	return min(x, y)
q = int(input())
for query in range(q):
	(a, b, c) = map(int, input().split())
	res = max(solve(a, b, c), solve(b, c, a), solve(c, a, b))
	print(res)


from sys import stdin, stdout
import collections
Q = int(input())
for i in range(Q):
	(A, B, C) = [int(x) for x in stdin.readline().split()]
	print((A + B + C) // 2)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	candy = list(map(int, stdin.readline().split()))
	stdout.write('%d\n' % (sum(candy) // 2))


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def int1():
	return int(input())
import string
import math
from itertools import combinations

def main():
	t = int(input())
	while t > 0:
		l = get_array()
		l.sort()
		a = l[0]
		b = l[1]
		if l[2] % 2 == 0:
			a = a + l[2] // 2
			b = b + l[2] // 2
			print((a + b) // 2)
		else:
			a = a + l[2] // 2
			b = b + l[2] // 2 + 1
			print((a + b) // 2)
		t = t - 1
main()


n = int(input())
for i in range(n):
	arr = [int(s) for s in input().split()]
	rez = sum(arr) // 2
	print(rez)


q = int(input())
for q1 in range(q):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	print(s // 2)


def inp():
	return int(input())
for _ in range(inp()):
	(a, b, c) = sorted(map(int, input().split()))
	p = a
	q = b
	d = min(q - p, c)
	p += d
	c -= d
	if c:
		print(p + c // 2)
	else:
		print(min(p, q))


import math
n = int(input())
while n:
	l = list(map(int, input().split()))
	l.sort()
	z = max(l)
	if z % 2 == 0:
		z1 = z // 2
		a = l[0] + z1
		b = l[1] + z1
		ans = (a + b) // 2
		print(ans)
	else:
		z1 = z // 2
		a = l[0] + (z - z1)
		b = l[1] + z1
		ans = (a + b) // 2
		print(ans)
	n = n - 1


import math

class Read:

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	(a, b, c) = Read.list_int()
	print((a + b + c) // 2)
query_count = Read.int()
for j in range(query_count):
	solve()


for _ in range(int(input())):
	(a, b, n) = map(int, input().split())
	cb = min(a, b, n)
	cp = max(a, b, n)
	ca = a + b + n - cb - cp
	cp -= ca - cb
	cb += ca - cb
	if cp % 2 == 0:
		ca += cp // 2
		cb += cp // 2
	else:
		cp -= 1
		ca += cp // 2
		cb += cp // 2
	print(ca)


q = int(input())
n = []
for i in range(1, q + 1):
	(p, q, r) = map(int, input().split())
	n.append([p, q, r])
for i in n:
	x = int(sum(list(i)) // 2)
	print(x)


q = int(input())
for _ in range(q):
	arr = list(map(int, input().split()))
	arr.sort()
	al = 0
	bob = 0
	al += arr[0]
	bob += arr[1]
	arr[2] = arr[2] - (bob - al)
	print(bob + int(arr[2] // 2))


q = int(input())
num = 0
for _ in range(q):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	if (a + b + c) % 2 == 0:
		print((a + b + c) // 2)
	else:
		print((a + b + c - 1) // 2)


t = int(input())
while t:
	l = list(map(int, input().split()))
	l.sort()
	c = l[1] - l[0]
	l[2] = l[2] - c
	l[1] = l[1] + l[2] // 2
	print(l[1])
	t = t - 1


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
for _ in range(ii()):
	s = sum(li())
	(q, r) = divmod(s, 2)
	print(q)


T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	t = [a, b, c]
	t = sorted(t)
	a = t[0]
	b = t[1]
	c = t[2]
	ans = max(a, b)
	c = max(0, c - (b - a))
	ans = ans + c // 2
	print(ans)


n = int(input())
I = []
for i in range(n):
	k = [int(i) for i in input().split()]
	I.append(k)

def output(l):
	s = 0
	for i in l:
		s += i
	return s // 2
for i in range(n):
	print(output(I[i]))


q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	if abs(a - b) < abs(a - c) and abs(a - b) < abs(b - c):
		print((c - (max(a, b) - min(a, b))) // 2 + max(a, b))
	elif abs(a - c) < abs(a - b) and abs(a - c) < abs(c - b):
		print((b - (max(a, c) - min(a, c))) // 2 + max(a, c))
	else:
		print((a - (max(b, c) - min(b, c))) // 2 + max(b, c))


from itertools import repeat

def line():
	inp = input().split()
	if len(inp) == 1:
		return int(inp[0])
	return map(int, inp)
q = line()
for _ in repeat(None, q):
	(a, b, c) = sorted(line())
	print(b + (c - (b - a)) // 2)


for _ in range(int(input())):
	a = list(map(int, input().strip().split()))
	a.sort()
	b = a[1] - a[0]
	c = a[2] - b
	c = c // 2
	print(str(a[1] + c))


n = int(input())
arr = []
for i in range(n):
	arr += [[int(i) for i in filter(None, input().split(' '))]]
for i in range(n):
	print(sum(arr[i]) // 2)


import math
for iter in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(math.floor((a + b + c) // 2))


import math
t = int(input())
for _ in range(t):
	li = [int(k) for k in input().split()]
	li.sort()
	a = abs(li[1] - li[0])
	ans = math.ceil((li[2] - a) / 2)
	x = li[1] + ans
	y = li[0] + (li[2] - ans)
	if x == y:
		print(x)
	else:
		print(min(x, y))


q = int(input())
while q:
	q = q - 1
	can = [int(x) for x in input().split()]
	print(sum(can) // 2)


n = int(input())
for _ in range(n):
	a = list(map(int, input().split()))
	summ = sum(a)
	print(summ // 2)


q = int(input())
while q:
	print(sum(list(map(int, input().split()))) // 2)
	q -= 1


a = input()
i = int(a)
n = 0
count = 0
sum = 0
lst1 = []
while n < i:
	sum = 0
	b = input()
	lst = b.split(' ')
	for k in lst:
		sum += int(k)
	lst1.append(sum // 2)
	n += 1
for j in lst1:
	print(int(j))


q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	L = [a, b, c]
	L = sorted(L)
	d = L[0]
	e = L[1]
	f = L[2]
	if e - d >= L[2]:
		print(d + L[2])
	else:
		f = f - (e - d)
		d = e
		print(e + f // 2)


import sys
input = lambda : sys.stdin.readline().strip()
T = int(input())
for i in range(T):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


q = int(input())
for k in range(q):
	(a, b, c) = map(int, input().split())
	print(int((a + b + c) // 2))


for _ in range(int(input())):
	print(sum([int(v) for v in input().split()]) // 2)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	one = a[0]
	two = a[1]
	three = a[2]
	val = (three - (two - one)) // 2
	print(two + val)


from collections import defaultdict as df
import bisect
from collections import deque
import heapq
q = int(input())
for i in range(q):
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)


for TT in range(1, int(input()) + 1):
	(a, b, c) = sorted(map(int, input().split()))
	print(b + (c - (b - a)) // 2)


n = int(input())
for i in range(n):
	mas = list(map(int, input().split()))
	mas.sort()
	print(sum(mas) // 2)


test = int(input())
for _ in range(test):
	ls1 = list(map(int, input().split()))
	ls1.sort()
	x = (sum(ls1) - 2 * ls1[0]) // 2
	print(str(min(ls1[0] + x, ls1[1] + ls1[2] - x)))


n = int(input())
for i in range(n):
	(x, y, z) = map(int, input().split())
	s = x + y + z
	if s % 2 == 0:
		print(int(s // 2))
	else:
		s = s - 1
		print(s // 2)


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	a.sort()
	al = a[0]
	bo = a[1]
	d = bo - al
	al = al + d
	a[2] = a[2] - d
	r = a[2] // 2
	print(al + r)
	t = t - 1


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	mx = max(a, b)
	mx += (c - abs(a - b)) // 2
	print(mx)


q = int(input())
out = []
for i in range(q):
	z = input()
	k = z.split(' ')
	l = [int(x) for x in k]
	sum = 0
	for elem in l:
		sum += elem
	out.append(sum // 2)
for e in out:
	print(e)


q = int(input())
for i in range(q):
	arr = list(map(int, input().split()))
	max = sum(arr[:3]) // 2
	print(max)


q = int(input())
while q > 0:
	a = [int(i) for i in input().split()]
	tot = sum(a)
	if tot & 1:
		tot -= 1
	print(tot >> 1)
	q -= 1


q = int(input())
while q > 0:
	q -= 1
	(n, m, a) = map(int, input().split())
	print((n + m + a) // 2)


for i in [0] * int(input()):
	(n, s, t) = map(int, input().split())
	print((n + s + t) // 2)


for rpt in range(int(input())):
	numbers = [int(x) for x in input().split(' ')]
	numbers.sort()
	if numbers[2] - numbers[1] <= numbers[0]:
		print(numbers[2] + (numbers[0] - (numbers[2] - numbers[1])) // 2)
	else:
		print(numbers[1] + (numbers[2] - (numbers[1] - numbers[0])) // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	l = [a, b, c]
	l.sort()
	(a, b, c) = l
	if b == c:
		print(b + a // 2)
	elif b < c:
		if b + a == c:
			print(c)
		if b + a > c:
			k = b + a - c
			print(c + k // 2)
		if b + a < c:
			k = abs(b + a - c)
			print(b + a + k // 2)


class cinn:

	def __init__(self):
		self.x = []

	def cin(self, t=int):
		if len(self.x) == 0:
			a = input()
			self.x = a.split()
			self.x.reverse()
		return self.get(t)

	def get(self, t):
		return t(self.x.pop())

	def clist(self, n, t=int):
		l = [0] * n
		for i in range(n):
			l[i] = self.cin(t)
		return l

	def clist2(self, n, t1=int, t2=int, t3=int, tn=2):
		l = [0] * n
		for i in range(n):
			if tn == 2:
				a1 = self.cin(t1)
				a2 = self.cin(t2)
				l[i] = (a1, a2)
			elif tn == 3:
				a1 = self.cin(t1)
				a2 = self.cin(t2)
				a3 = self.cin(t3)
				l[i] = (a1, a2, a3)
		return l

	def clist3(self, n, t1=int, t2=int, t3=int):
		return self.clist2(self, n, t1, t2, t3, 3)

	def cout(self, i, ans=''):
		if ans == '':
			print('Case #' + str(i + 1) + ':', end=' ')
		else:
			print('Case #' + str(i + 1) + ':', ans)

	def printf(self, thing):
		print(thing, end='')

	def countlist(self, l, s=0, e=None):
		if e == None:
			e = len(l)
		dic = {}
		for el in range(s, e):
			if l[el] not in dic:
				dic[l[el]] = 1
			else:
				dic[l[el]] += 1
		return dic

	def talk(self, x):
		print(x, flush=True)

	def dp1(self, k):
		L = [-1] * k
		return L

	def dp2(self, k, kk):
		L = [-1] * k
		for i in range(k):
			L[i] = [-1] * kk
		return L

	def isprime(self, n):
		if n == 1 or n == 0:
			return False
		for i in range(2, int(n ** 0.5 + 1)):
			if n % i == 0:
				return False
		return True

	def factors(self, n):
		from functools import reduce
		return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

	def nthprime(self, n):
		i = 0
		s = 2
		L = []
		while i < n:
			while not self.isprime(s):
				s += 1
			L.append(s)
			s += 1
			i += 1
		return L

	def matrixin(self, m, n, t=int):
		L = []
		for i in range(m):
			p = self.clist(n, t)
			L.append(p)
		return L

	def seive(self, k):
		n = k + 1
		L = [True] * n
		L[1] = False
		L[0] = False
		for i in range(2, n):
			if L[i] == True:
				for j in range(2 * i, n, i):
					L[j] = False
		return L

	def seiven(self, n, L):
		i = 0
		for j in range(len(L)):
			if L[j] == True:
				i += 1
			if i == n:
				return j

	def matrixin2(self, m, t=int):
		L = []
		for i in range(m):
			iny = self.cin(str)
			lsmall = []
			for el in iny:
				lsmall.append(t(el))
			L.append(lsmall)
		return L
c = cinn()
que = c.cin()
for i in range(que):
	q = c.cin()
	x = c.cin()
	z = c.cin()
	print((x + z + q) // 2)


q = int(input())
for _ in range(q):
	(a, b, c) = list(map(int, input().split()))
	sum = a + b + c
	print(sum // 2)


n = int(input())
for i in range(n):
	sm = sum(map(int, input().split()))
	print(sm // 2)


n = int(input())
maxi = []
for i in range(n):
	(p1, p2, p3) = input().split()
	p1 = int(p1)
	p2 = int(p2)
	p3 = int(p3)
	count = 0
	summ = p1 + p2 + p3
	lnum = 2000000000000000
	while summ > lnum:
		summ = summ - lnum
		count += 1
	p = count * 1000000000000000 + int(summ / 2)
	maxi.append(p)
for i in maxi:
	print(i)


q = int(input())
for query in range(q):
	candy = list(map(int, input().split()))
	candy.sort()
	a = candy[1]
	b = candy[0]
	ans = a + (candy[2] - (a - b)) // 2
	print(ans)


def func(q):
	q = list(map(int, q.split()))
	if sum(q) % 2 == 0:
		return sum(q) // 2
	else:
		return (sum(q) - 1) // 2

def main():
	t = int(input())
	for i in list(map(func, [input() for i in range(t)])):
		print(i)
main()


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s
t = ii()
for a0 in range(t):
	l = li()
	print(sum(l) // 2)


n = int(input())
for _ in range(n):
	a = list(map(int, input().split()))
	a.sort()
	if a[2] <= a[1] - a[0]:
		result = a[0] + a[2]
	else:
		result = a[1] + (a[2] - (a[1] - a[0])) // 2
	print(result)


t = int(input())
for i in range(t):
	[j, k, l] = list(map(int, input().split()))
	print((j + k + l) // 2)


n = int(input())
l = []
s = 0
k = []
for i in range(n):
	q = input()
	l = q.split(' ')
	for j in l:
		s = s + int(j)
	k.append(s // 2)
	s = 0
for i in k:
	print(i)


x = int(input())
int(x)
a = x
for i in range(0, a):
	(a, b, c) = map(int, input().split())
	z = a + b + c
	amol = z // 2
	int(amol)
	print(amol)


q = int(input())
for i in range(q):
	a = list(map(int, input().split()))
	alice = max(a)
	a.remove(max(a))
	bob = max(a)
	a.remove(max(a))
	alice += max(a)
	x = alice - bob
	if x % 2 == 1:
		x += 1
	print(alice - x // 2)


q = int(input())
while q:
	q = q - 1
	l = list(map(int, input().split()))
	l.sort()
	x = sum(l)
	if x % 2 != 0:
		x = x - 1
	print(x // 2)


def calculate(a, b, c):
	if c >= b - a:
		tp = b - a
		a += b - a
		c -= tp
	else:
		a += c
		c = 0
	if c == 0:
		return min(a, b)
	a += c // 2
	b += c - c // 2
	return min(a, b)
for _ in range(int(input())):
	(a, b, c) = (int(s) for s in input().split())
	ans1 = calculate(min(a, b), max(a, b), c)
	ans2 = calculate(min(a, c), max(a, c), b)
	ans3 = calculate(min(c, b), max(c, b), a)
	print(max(ans1, ans2, ans3))


N = int(input())
arr = {}
for i in range(0, N):
	(a, b, c) = map(int, input().split())
	arr[i] = (a + b + c) // 2
for i in range(len(arr)):
	print(arr[i])


q = int(input())
for i in range(0, q):
	(p1, p2, p3) = map(int, input().split())
	print((p1 + p2 + p3) // 2)


n = int(input())
i = 0
data = list()
while i < n:
	num = input()
	arr = []
	counting = 0
	for m in range(0, len(num)):
		if num[m] == ' ':
			arr.append(int(num[counting:m]))
			counting = m + 1
		elif m == len(num) - 1:
			arr.append(int(num[counting:len(num)]))
	data.append(arr)
	i += 1
for num in data:
	answer = 0
	for i in range(0, len(num)):
		if num[i] % 2 == 0:
			answer += int(num[i] / 2)
		elif num[i] % 2 == 1:
			answer += int((num[i] - 1) / 2)
			if i != len(num) - 1:
				num[i + 1] += 1
	print(answer)


def solve(costs):
	print(sum(costs) // 2)

def main():
	for i in range(int(input())):
		solve([int(x) for x in input().split()])
main()


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	li = LIST()
	ans = sum(li) // 2
	print(ans)


T = int(input())
for t in range(T):
	(a, b, c) = list(map(int, input().split()))
	ans = (a + b + c) // 2
	print(ans)


q = int(input())
while q > 0:
	(x, y, z) = map(int, input().split())
	print((x + y + z) // 2)
	q -= 1


n = int(input())
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	print(s // 2)


n = int(input())
for i in range(n):
	n1 = list(map(int, input().split()))
	if n1[0] < n1[1]:
		s = n1[1] - n1[0]
		w = n1[1] - s
		x = n1[2] + s
		z = x // 2
		print(w + z)
	else:
		s = n1[0] - n1[1]
		w = n1[0] - s
		x = n1[2] + s
		z = x // 2
		print(w + z)


x = int(input())
for i in range(x):
	nums = [int(x) for x in input().split()]
	nums.sort()
	alice = nums[0]
	bob = nums[1]
	split = nums[2]
	if split >= bob - alice:
		print(sum(nums) // 2)
	else:
		print(alice + split)


for i in range(int(input())):
	a = list(map(int, input().split()))
	maxa = max(a)
	mina = min(a)
	mida = sum(a) - maxa - mina
	alice = mida
	bob = mina
	temp = alice - bob
	bob += temp
	maxa -= temp
	alice += maxa // 2
	print(alice)


count = int(input())
for i in range(count):
	data = map(int, input().split())
	data = sorted(data)
	print((data[0] + data[1] + data[2]) // 2)


for i in range(int(input())):
	l = list(map(int, input().split()))
	for j in range(len(l)):
		for k in range(len(l)):
			if l[k] > l[j]:
				temp = l[k]
				l[k] = l[j]
				l[j] = temp
	while l[2] > 0:
		if l[1] > l[0]:
			l[2] -= l[1] - l[0]
			l[0] += l[1] - l[0]
		else:
			l[0] += l[2] // 2
			l[1] += l[2] // 2
			l[2] -= l[2]
	print(l[0])


q = int(input())
fin = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	tot = a + b + c
	rem = tot // 2
	fin.append(rem)
for i in range(q):
	print(fin[i], sep='\n')


n = int(input())
k = []
for i in range(n):
	s = input().split()
	for i in range(len(s)):
		s[i] = int(s[i])
	k.append(s)
for i in range(n):
	print((k[i][0] + k[i][1] + k[i][2]) // 2)


alisesum = 0
bobsum = 0
n = int(input())
for i in range(n):
	mylist = []
	candies = input().split()
	a1 = int(candies[0])
	a2 = int(candies[1])
	a3 = int(candies[2])
	alisesum = a1
	bobsum = a2
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a3 // 2
	bobsum += a3 // 2
	mylist.append(min(alisesum, bobsum))
	alisesum = a1
	bobsum = a3
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a2 // 2
	bobsum += a2 // 2
	mylist.append(min(alisesum, bobsum))
	alisesum = a2
	bobsum = a1
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a3 // 2
	bobsum += a3 // 2
	mylist.append(min(alisesum, bobsum))
	alisesum = a2
	bobsum = a3
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a1 // 2
	bobsum += a1 // 2
	mylist.append(min(alisesum, bobsum))
	alisesum = a3
	bobsum = a1
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a2 // 2
	bobsum += a2 // 2
	mylist.append(min(alisesum, bobsum))
	alisesum = a3
	bobsum = a2
	r = int(abs(alisesum - bobsum) / 2)
	if alisesum > bobsum:
		alisesum -= r
		bobsum += r
	else:
		alisesum += r
		bobsum -= r
	alisesum += a1 // 2
	bobsum += a1 // 2
	mylist.append(min(alisesum, bobsum))
	print(max(mylist))


test = int(input())
for x in range(test):
	lista = list(map(int, input().split()))
	print(int(sum(lista) // 2))


for _ in range(int(input())):
	candies = [int(i) for i in input().split()]
	total = sum(candies)
	if total % 2 == 0:
		print(total // 2)
	else:
		print((total - 1) // 2)


q = int(input())
for i in range(q):
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	c = int(l[2])
	x = [a, b, c]
	x.sort()
	t = c - (b - a)
	print(b + t // 2)


N = int(input())
A = []
for _ in range(N):
	A.append(list(map(int, input().split())))
for a in A:
	b = sum(a)
	print(b // 2)


n = int(input())
for i in range(n):
	a = sorted([int(s) for s in input().split()])
	k = a[1] - a[0]
	a[0] += k
	a[2] -= k
	k = a[2] // 2
	print(a[0] + k)


q = int(input())
a = []
for i in range(q):
	b = map(int, input().split())
	b = list(b)
	a.append(b)
for i in range(q):
	s = sum(a[i])
	if s % 2 == 0:
		print(s // 2)
	else:
		print((s - 1) // 2)


t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().strip().split()))
	print((a + b + c) // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a + b == c:
		print(c)
	elif b + c == a:
		print(a)
	elif a + c == b:
		print(b)
	elif a >= b:
		c = c - (a - b)
		print(a + c // 2)
	else:
		c = c - (b - a)
		print(b + c // 2)


queries = int(input())
for q in range(queries):
	print(sum(map(int, input().split(' '))) // 2)


def Bitplus():
	n = int(input())
	x = 0
	for i in range(n):
		a = input()
		if '+' in a:
			x += 1
		else:
			x -= 1
	print(x)

def GiftSetidk():
	n = int(input())
	for i in range(n):
		all = input().split(' ')
		x = int(all[0])
		y = int(all[1])
		a = int(all[2])
		b = int(all[3])
		counter = 0
		count = True
		while count:
			if x >= a and y >= b:
				x -= a
				y -= b
				counter += 1
			elif x >= b and y >= a:
				x -= b
				y -= a
				counter += 1
			else:
				count = False
		print(counter)

def Team():
	n = int(input())
	problemcount = 0
	for i in range(n):
		count = 0
		answer = input().split(' ')
		for i in range(len(answer)):
			answer[i] = int(answer[i])
		for i in answer:
			if i == 1:
				count += 1
		if count >= 2:
			problemcount += 1
	print(problemcount)

def NextRound():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	print(n, k)
	scores = input().split(' ')
	count = 0
	for i in range(n):
		scores[i] = int(scores[i])
	five = scores[k]
	for i in range(n):
		if scores[i] >= five and scores[i] > 0:
			count += 1
	print(count)

def Beautifulmatrix():
	steps = 0
	matrixes = []
	for i in range(5):
		i = [input().split(' ')]
		matrixes += i
	for i in range(5):
		for j in range(5):
			matrixes[i][j] = int(matrixes[i][j])
	for i in range(5):
		for j in range(5):
			if matrixes[i][j] > 0:
				x = j
				y = i
				break
	while x != 2 or y != 2:
		if x > 2:
			x -= 1
			steps += 1
		elif x < 2:
			x += 1
			steps += 1
		elif y > 2:
			y -= 1
			steps += 1
		elif y < 2:
			y += 1
			steps += 1
	print(steps)

def HelpfulMahts():
	s = input().split('+')
	s.sort()
	print('+'.join(s))

def WordCapitalization():
	word = input()
	List = []
	for i in word:
		List.append(i)
	List[0] = List[0].upper()
	s = ''
	for i in List:
		s += i
	print(s)

def Stonesonthetable():
	n = int(input())
	stones = []
	rrg = input()
	counter = 0
	for i in rrg:
		stones.append(i)
	for i in range(n - 1):
		if stones[i] == stones[i + 1]:
			counter += 1
	print(counter)

def BearandBigBrother():
	inpuut = input().split(' ')
	a = int(inpuut[0])
	b = int(inpuut[1])
	year = 0
	while a <= b:
		a *= 3
		b *= 2
		year += 1
	print(year)

def Wrongsubtraction():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	for i in range(k):
		p = str(n)
		if p[len(p) - 1] == '0':
			n //= 10
		else:
			n -= 1
	print(n)
import string

def Word():
	word = input()
	lower = 0
	upper = 0
	for i in word:
		if i in string.ascii_lowercase:
			lower += 1
		else:
			upper += 1
	if upper > lower:
		word = word.upper()
	else:
		word = word.lower()
	print(word)

def QueueattheSchool():
	nt = input().split(' ')
	n = nt[0]
	t = int(nt[1])
	a = input()
	b = []
	ref = ''
	for i in a:
		b.append(i)
	for k in range(t):
		whre = []
		for i in range(len(b) - 1):
			if b[i] == 'B' and b[i + 1] != 'B':
				whre.insert(0, i)
		for j in whre:
			b.pop(j)
			b.insert(j + 1, 'B')
	for i in b:
		ref += i
	print(ref)

def Nearlyluckynumber():
	n = input()
	if n.count('7') + n.count('4') == 7 or n.count('7') + n.count('4') == 4:
		print('YES')
	else:
		print('NO')

def Translation():
	s = input()
	t = input()
	n = []
	for i in t:
		n.insert(0, i)
	t = ''
	for i in n:
		t += i
	if t == s:
		print('YES')
	else:
		print('NO')

def ANTONandDanik():
	n = int(input())
	s = input()
	A = s.count('A')
	D = s.count('D')
	if A > D:
		print('Anton')
	elif D > A:
		print('Danik')
	else:
		print('Friendship')

def GeorgeandAccomodation():
	n = int(input())
	rooms = 0
	for i in range(n):
		pq = input().split(' ')
		p = int(pq[0])
		q = int(pq[1])
		if q - p >= 2:
			rooms += 1
	print(rooms)

def Magnets():
	n = int(input())
	Rows = []
	groups = 1
	for i in range(n):
		Rows += [input()]
	for i in range(n - 1):
		if Rows[i] != Rows[i + 1]:
			groups += 1
	print(groups)

def InSearcoanEasyProblem():
	n = int(input())
	counter = 0
	s = input().split(' ')
	if '1' in s:
		print('HARD')
	else:
		print('EASY')

def Hulk():
	c = int(input())
	i = 'I'
	s = ''
	it = 'it'
	for i in range(1, c + 1):
		if i == 1:
			s += 'hate '
		elif i % 2 == 0:
			s += 'that I love '
		else:
			s += 'that I hate '
	print(f'I {s}it')

def CalculatingFunctionidk():
	n = int(input())
	c = 0
	for i in range(1, n + 1):
		if i % 2 != 0:
			c -= i
		else:
			c += i
	print(c)

def IWannaBetheGuyidk():
	n = int(input())
	p = input().split(' ')
	q = input().split(' ')
	counter = 0
	for i in range(1, n + 1):
		if str(i) in p or str(i) in q:
			counter += 1
	if counter == n:
		print('I become the guy.')
	else:
		print('Oh, my keyboard!')

def horsesheo():
	n = input().split(' ')
	many = 4
	whatwas = []
	for i in range(len(n)):
		n[i] = int(n[i])
		if n[i] not in whatwas:
			whatwas.append(n[i])
	print(many - len(whatwas))

def ArrivaloftheGeneralidk():
	n = int(input())
	a = input().split(' ')
	max = 0
	minlist = []
	for i in range(n):
		a[i] = int(a[i])
	for i in a:
		if i > max:
			max = i
	maxloc = a.index(max)
	for i in a:
		minlist.insert(0, i)
	min = max
	for i in a:
		if i < min:
			min = i
	minloc = minlist.index(min)
	print(minloc + maxloc)

def UltraFastMathematician():
	first = input()
	second = input()
	s = ''
	for i in range(len(first)):
		if first[i] == '0' and second[i] == '1':
			s += '1'
		elif first[i] == '1' and second[i] == '0':
			s += '1'
		elif first[i] == '0' and second[i] == '0':
			s += '0'
		elif first[i] == '1' and second[i] == '1':
			s += '0'
	print(s)

def Insomniacure():
	klmn = []
	for i in range(4):
		klmn.append(int(input()))
	d = int(input())
	List = []
	if 1 in klmn:
		return d
	for i in range(4):
		mulit = klmn[i]
		while klmn[i] <= d:
			if klmn[i] not in List:
				List.append(klmn[i])
			klmn[i] += mulit
	return len(List)

def AntonandLetters():
	first = input()
	List = []
	for i in first:
		if i not in List and i in string.ascii_lowercase:
			List.append(i)
	print(len(List))

def Pangram():
	n = int(input())
	word = input().lower()
	List = []
	if n >= 26:
		for i in word:
			if i not in List:
				List.append(i)
		if len(List) == 26:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')

def Collectingcoons():
	n = int(input())
	for i in range(n):
		abcd = input().split(' ')
		for i in range(len(abcd)):
			abcd[i] = int(abcd[i])
		d = abcd[3]
		abcd.pop()
		maxi = 0
		for i in abcd:
			if i > maxi:
				maxi = i
		allindexes = [0, 1, 2]
		indexmax = abcd.index(maxi)
		allindexes.pop(indexmax)
		allminus = 0
		for i in allindexes:
			allminus += abcd[indexmax] - abcd[i]
		d -= allminus
		if d % 3 == 0 and d >= 0:
			print('YES')
		else:
			print('NO')

def Brainsphotos():
	nm = input().split(' ')
	colors = []
	for i in range(int(nm[0])):
		colors += input().split(' ')
	for i in colors:
		if i == 'C' or i == 'M' or i == 'Y':
			return '#Color'
	return '#Black&White'

def SerejaandDima():
	n = int(input())
	card = input().split(' ')
	S = 0
	D = 0
	sturn = True
	for i in range(n):
		if int(card[0]) > int(card[len(card) - 1]):
			if sturn:
				S += int(card[0])
				card.pop(0)
				sturn = False
			else:
				D += int(card[0])
				card.pop(0)
				sturn = True
		elif sturn:
			S += int(card[len(card) - 1])
			card.pop(len(card) - 1)
			sturn = False
		else:
			D += int(card[len(card) - 1])
			card.pop(len(card) - 1)
			sturn = True
	print(f'{S} {D}')

def Vanyaandcubes():
	n = int(input())
	counter = 1
	countdodo = 0
	rows = 0
	while n > 0:
		countdodo += counter
		counter += 1
		rows += 1
		n -= countdodo
	if n == 0:
		print(rows)
	else:
		print(rows - 1)

def GennadyandaCarGame():
	card = input()
	cards = input().replace(' ', '')
	for i in card:
		for j in cards:
			if i == j:
				return 'YES'
	return 'NO'

def FafaandhisCompany():
	n = int(input())
	ways = 0
	for i in range(1, n):
		a = n
		a -= i
		if a % i == 0:
			ways += 1
	print(ways)

def Mahmoudandehabandtheevenoddgame():
	n = int(input())
	Mahmoudsturn = True
	Mahmoudlsot = False
	Ehablost = False
	a = 0
	while not Mahmoudlsot and (not Ehablost):
		if Mahmoudsturn:
			if n % 2 == 0 and n >= 2:
				Ehablost = True
			elif n % 2 != 0 and n >= 2:
				a = n - 1
			else:
				Mahmoudlsot = True
		elif n % 2 == 1 and n >= 1:
			Mahmoudlsot = True
		elif n % 2 == 0 and n >= 1:
			a = n - 1
		else:
			Ehablost = False
		n -= a
		if Mahmoudsturn == True:
			Mahmoudsturn = False
		else:
			Mahmoudsturn = True
	if Mahmoudlsot == True:
		print('Ehab')
	else:
		print('Mahmoud')

def FloorNumber():
	t = int(input())
	for i in range(t):
		nx = input().split(' ')
		n = int(nx[0])
		x = int(nx[1])
		aparteements = 2
		floor = 1
		while n > aparteements:
			aparteements += x
			floor += 1
		print(floor)

def VustheCossackandaContest():
	nmk = input().split(' ')
	n = int(nmk[0])
	m = int(nmk[1])
	k = int(nmk[2])
	if n <= m and n <= k:
		print('Yes')
	else:
		print('No')

def NightattheMuseum():
	word = input()
	rotations = 0
	lower = string.ascii_lowercase + string.ascii_lowercase + string.ascii_lowercase
	loc = lower.index('a', 26, 2 * 26)
	for i in word:
		cplus = loc
		cminus = loc
		keep = True
		while keep:
			if i == lower[cplus] or i == lower[cminus]:
				keep = False
			else:
				cplus += 1
				cminus -= 1
				rotations += 1
				loc = lower.index(i, 26, 2 * 26)
	print(rotations)

def OrdinarYnumbers():
	n = int(input())
	for i in range(n):
		k = int(input())
		counter = 0
		for j in range(1, k + 1):
			a = str(j)
			if len(a) == a.count(a[0]):
				counter += 1
		print(counter)

def DieRoll():
	n = input().split(' ')
	y = int(n[0])
	w = int(n[1])
	number = 0
	dec = 6
	if y >= w:
		for i in range(y, 7):
			number += 1
	else:
		for i in range(w, 7):
			number += 1
	if number % 6 == 0:
		number = number // 6
		dec = 1
	elif number % 3 == 0:
		number = number // 3
		dec = 2
	elif number % 2 == 0:
		number = number // 2
		dec = 3
	print(f'{number}/{dec}')

def Borze():
	n = input()
	l = ''
	k = ''
	for i in n:
		if i == '.' and len(l) == 0:
			k += '0'
		else:
			l += i
			if len(l) == 2:
				if l == '-.':
					k += '1'
					l = ''
				else:
					k += '2'
					l = ''
	print(k)

def FairPlayoff():
	n = int(input())
	for i in range(n):
		loser = {}
		winner = {}
		count = 0
		k = input().split(' ')
		if int(k[0]) > int(k[1]):
			loser['one'] = int(k[1])
			winner['two'] = int(k[0])
		else:
			loser['one'] = int(k[0])
			winner['two'] = int(k[1])
		if int(k[2]) > int(k[3]):
			loser['two'] = int(k[3])
			winner['one'] = int(k[2])
		else:
			loser['two'] = int(k[2])
			winner['one'] = int(k[3])
		for i in loser:
			if loser[i] < winner[i]:
				count += 1
		if count >= 2:
			print('YES')
		else:
			print('NO')

def Bustoudaylanbd():
	n = int(input())
	s = []
	rem = -1
	first = True
	ss = ''
	for i in range(n):
		s += input().split('|')
	for i in range(len(s)):
		if s[i] == 'OO' and first:
			rem = i
			s[i] = '++'
			first = False
	for i in range(len(s)):
		if i % 2 == 0:
			ss += s[i] + '|'
		else:
			ss += s[i] + '\n'
	if not first:
		print('YES')
		print(ss)
	else:
		print('NO')

def Maximumincrease():
	n = int(input())
	arraa = input().split(' ')
	for i in range(len(arraa)):
		arraa[i] = int(arraa[i])
	counter = {}
	for i in range(n):
		counter[i] = 0
	count = 0
	last = 0
	for i in arraa:
		if i > last:
			last = i
			counter[count] += 1
		else:
			last = i
			count += 1
			counter[count] += 1
	max = 0
	for i in range(n):
		if counter[i] > max:
			max = counter[i]
	print(max)

def Jugglingletters():
	n = int(input())
	for i in range(n):
		k = int(input())
		s = ''
		map = {}
		possible = True
		for i in range(k):
			s += input()
		for i in s:
			if i not in map:
				map[i] = 1
			else:
				map[i] += 1
		for i in map:
			if map[i] % k != 0:
				possible = False
		if possible:
			print('YES')
		else:
			print('NO')

def Panoramixsprediction():
	nm = input().split(' ')
	n = int(nm[0])
	m = int(nm[1])
	first = True
	for i in range(n + 1, m):
		count = 0
		for j in range(2, i):
			if i % j == 0:
				count += 1
		if count == 0:
			first = False
			break
	if first:
		count = 0
		for j in range(2, m):
			if m % j == 0:
				count += 1
		if count == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')

def ThreepilesofCanides():
	k = int(input())
	for i in range(k):
		n = input().split(' ')
		canides = 0
		for i in n:
			canides += int(i)
		if canides % 2 != 0:
			canides -= 1
		print(canides // 2)
ThreepilesofCanides()


ll = lambda : list(map(int, input().split()))
testcases = 1
testcases = int(input())
for testcase in range(testcases):
	[a, b, c] = ll()
	print((a + b + c) // 2)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	x = (a[2] + a[1] - a[0]) // 2
	print(min(a[0] + x, a[1] + a[2] - x))


def main():
	t = int(input())
	while t > 0:
		t -= 1
		line = input().split()
		v = [int(x) for x in line]
		(ans, sum) = (0, 0)
		for i in range(3):
			sum += v[i]
		for i in range(3):
			for j in range(i + 1, 3):
				mx = max(v[i], v[j])
				dif = abs(v[i] - v[j])
				rem = sum - v[i] - v[j]
				if rem < dif:
					continue
				rem -= dif
				cnt = mx + rem // 2
				ans = max(ans, cnt)
		print(ans)
main()


q = int(input())
s = ''
for i in range(q):
	(a, b, c) = map(int, input().split())
	s += str((a + b + c) // 2) + ' '
print(s.replace(' ', '\n'))


def get_ans(a, b, c):
	initial_diff = b - a
	if c > initial_diff:
		return max(a, b) + (c - initial_diff) // 2
	else:
		return min(a, b) + c
q = int(input())
for i in range(q):
	(a, b, c) = sorted(map(int, input().strip().split()))
	print(get_ans(a, b, c))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def solve(arr):
	arr.sort()
	return (arr[2] - (arr[1] - arr[0])) // 2 + arr[1]
n = inp()
while n != 0:
	basket = inlt()
	print(solve(basket))
	n = n - 1


tc = int(input())
final = []
for i in range(tc):
	temp = [int(j) for j in input().split()]
	final.append(temp)
for i in final:
	p = sum(i)
	print(p // 2)


def vip():
	l = list(map(int, input().split()))
	h = sum(l)
	y = h // 2
	print(y)
q = int(input())
for i in range(0, q):
	vip()


from heapq import heappush, heappop
from collections import deque, Counter, defaultdict
import itertools
import sys
sys.setrecursionlimit(10 ** 6)

def MI():
	return map(int, input().split())

def I():
	return int(input())

def LI():
	return [int(i) for i in input().split()]
q = I()
for _ in range(q):
	ans = 0
	(a, b, c) = LI()
	d = itertools.permutations((a, b, c))
	for (a, b, c) in d:
		c1 = (c - max(a - b, 0)) // 2
		c2 = c - c1
		ans = max(ans, min(a + c1, b + c2))
	print(ans)


def solve():
	(x, y, z) = sorted(list(map(int, input().split())))
	if x + z <= y:
		x += z
	else:
		d = y - x
		z -= d
		x += d
		z //= 2
		x += z
		y += z
	return x
q = int(input())
for _ in range(q):
	print(solve())


n = int(input())
ar = []
for i in range(1, n + 1):
	l = (x, y, z) = [int(a) for a in input().split()]
	ar.extend(l)
	k = (x + y + z) // 2
	print(k)


n = int(input())
for i in range(n):
	d = list(map(int, input().split()))
	diff = abs(d[0] - d[1])
	print((d[2] - diff) // 2 + max(d[0], d[1]))


import sys
q = int(sys.stdin.readline())
for line in sys.stdin:
	piles = [int(c) for c in line.split()]
	print(str(sum(piles) // 2))


from sys import stdin
q = int(input())
ans = [str(sum(map(int, line.split())) // 2) for line in stdin.readlines()]
print('\n'.join(ans))


false = False
true = True
null = None
TEST = false
try:
	import sys
	for arg in sys.argv:
		if arg == 'test':
			print('test mode')
			TEST = True
	pass
except:
	pass

def AddImports(libraryNames):
	for libname in libraryNames:
		if type(libname) == type(tuple()):
			short = libname[1]
			libname = libname[0]
		else:
			short = None
		try:
			lib = __import__(libname)
		except ImportError:
			pass
		else:
			if short:
				globals()[short] = lib
			else:
				globals()[libname] = lib
	return True
libnames = ['functools', 'math', 'collections']
AddImports(libnames)
IntellisenseHint = False
if IntellisenseHint:
	import functools
	import math
	import collections

def it(args, *arg):
	if TEST:
		print(args, *arg)

def floatEqual(a, b):
	diff = math.fabs(a - b)
	if diff < 1e-10:
		return True
	else:
		return diff <= 1e-08 * max(math.fabs(a), math.fabs(b))

def ria():
	return list(map(int, input().strip(' ').split(' ')))

def solve():
	q = ria()[0]
	for i in range(q):
		it('step')
		candies = ria()
		candies.sort()
		it(candies)
		[a, b, c] = candies
		gap = b - a
		a = a + gap if c - gap >= 0 else a + c
		c -= gap
		if c > 0:
			divc = math.floor(c // 2)
			a += divc
			b += divc
		it(a, b, c)
		print(a)
		pass
	pass
solve()


qs = int(input())
for q in range(qs):
	elems = [int(elem) for elem in input().split()]
	elems = sorted(elems)
	a = elems[0]
	b = elems[1]
	c = elems[2]
	diff = b - a
	a = a + diff
	c = c - diff
	if c != 0:
		a = a + c // 2
	print(a)


t = int(input())
for i in range(0, t):
	l = [int(i) for i in input().split()]
	l.sort()
	if l[2] < l[1] - l[0]:
		print(l[0] + l[2])
	else:
		l[2] = l[2] - l[1] + l[0]
		l[0] = l[1]
		print(l[0] + l[2] // 2)


q = int(input())
for _ in range(q):
	piles = [int(ele) for ele in input().split(' ')]
	s = sum(piles)
	print(s // 2)


import sys

def handle(l):
	l.sort()
	[a, b, c] = l
	f = b - a + c
	if f % 2 != 0:
		c = c - 1
	x = f // 2
	return a + x
sys.stdin.readline()
for line in sys.stdin:
	[a, b, c] = list(map(int, line.strip().split()))
	print(handle([a, b, c]))


q = int(input())
a1 = []
for i in range(q):
	(a, b, c) = [int(a) for a in input().split()]
	alice_cand = int((a + b + c) // 2)
	a1.append(alice_cand)
for i in a1:
	print(i)


t = int(input())
for x in range(t):
	C = list(map(int, input().split()))
	C.sort()
	if C[-2] - C[-3] < C[2] - C[-2]:
		C[-1] = C[-1] - (C[-2] - C[-3])
		C[-1] = C[-1] // 2
		C[-2] = C[-2] + C[-1]
		print(C[-2])
	else:
		C[-3] = C[-3] - (C[-1] - C[-2])
		C[-3] = C[-3] // 2
		C[-1] = C[-1] + C[-3]
		print(C[2])


n = int(input())
l = []
while n:
	(x, y, z) = map(int, input().split())
	s = x + y + z
	l.append(s // 2)
	n = n - 1
for i in l:
	print(i)


test = int(input())
for i in range(0, test):
	num1 = input()
	(a, b, c) = num1.split()
	a = int(a)
	b = int(b)
	c = int(c)
	sum = a + b + c
	if sum % 2 == 0:
		print(sum // 2)
	else:
		print((sum - 1) // 2)


n = int(input())
for _ in range(n):
	d = [int(v) for v in input().split()]
	s = sum(d)
	s = s // 2
	print(s)


for _ in range(int(input())):
	q = input().split()
	a = int(q[0])
	b = int(q[1])
	c = int(q[2])
	print((a + b + c) // 2)


import sys
input = sys.stdin.readline
out = sys.stdout

def main():
	q = int(input())
	for _ in range(q):
		t = list(map(int, input().split()))
		z = sum(t)
		out.write(str(z // 2) + '\n')
main()


q = int(input())
for i in range(0, q):
	str = input()
	tokens = str.split(' ')
	a = int(tokens[0])
	b = int(tokens[1])
	c = int(tokens[2])
	total_candies = a + b + c
	ideal_div = total_candies // 2
	min_pile = min(a, b, c)
	max_pile = max(a, b, c)
	mid_pile = total_candies - min_pile - max_pile
	if min_pile + mid_pile <= max_pile:
		print(ideal_div)
	else:
		alt_div = max_pile + (mid_pile - (max_pile - min_pile)) // 2
		print(alt_div)


x = input()
for i in range(0, int(x)):
	a = input().split(' ')
	sum = int(a[0]) + int(a[1]) + int(a[2])
	print(str(sum // 2))


import sys
Input = lambda : map(int, sys.stdin.readline().split())
for i in range(int(input())):
	a = list(Input())
	yy = sum(a)
	print(yy // 2)


q = int(input())
out = []
for i in range(q):
	s = 0
	l = list(map(int, input().split()))
	for j in range(3):
		s += l[j]
	out.append(s // 2)
for i in out:
	print(i)


a = int(input())
for i in range(a):
	(b, c, d) = map(int, input().split())
	k1 = max(b, c) + (d - abs(b - c)) // 2
	k3 = max(b, d) + (c - abs(b - d)) // 2
	k2 = max(d, c) + (b - abs(d - c)) // 2
	print(max(k1, k2, k1))


a = int(input())
L = []
for i in range(a):
	(b, c, d) = map(int, input().split())
	L.append((b + c + d) // 2)
for i in L:
	print(i)


for _ in range(int(input().strip(' '))):
	(a, b, c) = tuple(map(int, input().strip(' ').split(' ')))
	mx_c = (a + b + c) // 2
	print(mx_c)


t = int(input())
while t:
	(a, b, c) = [int(a) for a in input().split()]
	s = a + b + c
	print(s // 2)
	t -= 1


q = int(input())
f = ''
for _ in range(q):
	(a, b, c) = map(int, input().split())
	s = (a + b + c) // 2
	f += str(s) + '\n'
print(f)


n = int(input())
lst = []
for k in range(n):
	(a, b, c) = map(int, input().split())
	lst.append((a, b, c))
for L in lst:
	print((L[0] + L[1] + L[2]) // 2)


def solve(a, b, c):
	return (a + b + c) // 2
T = int(input())
for i in range(T):
	(a, b, c) = map(int, input().split())
	print(solve(a, b, c))


q = int(input())
for _ in range(q):
	(a, b, c) = map(int, input().split())
	sm = a + b + c
	ans = sm // 2
	print(ans)


t = int(input())
for i in range(t):
	s = [int(i) for i in input().split()]
	f = 0
	for i in s:
		f += i
	print(f // 2)


tc = int(input())
while tc != 0:
	tc -= 1
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


noOfQuerries = int(input())
Candles2D = []
for i in range(noOfQuerries):
	Candles2D.append(list(map(int, input().split())))
for t in range(noOfQuerries):
	total = 0
	for i in range(len(Candles2D[t])):
		total += Candles2D[t][i]
	print(total // 2)


from math import floor
for _ in range(int(input())):
	l = list(map(int, input().split()))
	print(sum(l) // 2)


for _ in range(0, int(input())):
	(a, b, c) = map(int, input().split())
	s = (a + b + c) // 2
	print(s)


t = int(input())
s = []
for fknjf in range(0, t):
	x = list(map(int, input().split()))
	a = sum(x)
	d = int(a // 2)
	s.append(d)
for i in s:
	print(i)


n = int(input())
for i in range(n):
	alice = 0
	bob = 0
	(a, b, c) = map(int, input().split())
	alice = a + c // 2
	bob = b + c // 2
	if bob > alice:
		d = bob - alice
		bob -= d
	else:
		d = alice - bob
		alice -= d
	x = (d + c % 2) // 2
	print(x + alice)


n = int(input())
x = []
for i in range(n):
	a = list(map(int, input().split()))
	x.append(a)
sum = 0
for i in range(n):
	sum = x[i][0] + x[i][1] + x[i][2]
	sum = sum // 2
	print(sum)


from sys import stdin
n = int(stdin.readline().rstrip())
for _ in range(n):
	(a, b, c) = map(int, stdin.readline().rstrip().split(' '))
	print((a + b + c) // 2)


from math import sqrt
import sys

def inpu():
	return sys.stdin.readline().strip()
q = int(input())
for i in range(q):
	mas = [int(i) for i in inpu().split()]
	a = sum(mas)
	if a % 2 != 0:
		a -= 1
	print(a // 2)


n = int(input())
for each in range(n):
	data = input().split(' ')
	for index in range(3):
		data[index] = int(data[index])
	data.sort()
	data[2] = data[2] - data[1] + data[0]
	print(data[1] + data[2] // 2)


n = int(input())
out = [0] * n
for i in range(n):
	arr = input().split()
	arr = [int(el) for el in arr]
	arr.sort()
	out[i] = arr[1] + (arr[2] - (arr[1] - arr[0])) // 2
for i in range(n):
	print(out[i])


n = int(input())
l1 = []
for i in range(n):
	l = list(map(int, input().split()))
	l1.append(sum(l) // 2)
for item in l1:
	print(item)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from heapq import heapify, heappop, heappush
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print((a + b + c) // 2)


for _ in range(int(input())):
	(a, b, c) = sorted(list(map(int, input().split())))
	alice = a
	bob = b
	alice += b - a
	c -= b - a
	print(alice + c // 2)


import sys
import copy
sys.setrecursionlimit(1000000)
from collections import defaultdict
Q = int(input())
for testcase in range(Q):
	a = map(int, input().split())
	print(sum(a) // 2)


x = int(input())
for i in range(x):
	ch = input()
	l = ch.split(' ')
	sume = 0
	for i in l:
		sume = sume + int(i)
	print(sume // 2)


import sys
q = int(sys.stdin.readline())
for _ in range(q):
	a = list(map(int, sys.stdin.readline().split()))
	res = sum(a) // 2
	print(res)


ans = []
q = int(input())
for i in range(q):
	inp = list(map(int, input().split()))
	x = sum(inp)
	if x % 2 != 0:
		x -= 1
	ans.append(int(x // 2))
for i in ans:
	print(i)


n = int(input())

def fun(x):
	dif = max(ali, bob) - min(ali, bob)
	if x >= dif:
		x -= dif
		print(max(ali, bob) + x // 2)
	else:
		print(min(ali, bob))
for _ in range(n):
	(a, b, c) = map(int, input().split())
	ali = min(a, b, c)
	if min(a, b, c) == a:
		bob = min(b, c)
	elif min(a, b, c) == b:
		bob = min(a, c)
	elif min(a, b, c) == c:
		bob = min(a, b)
	fun(max(a, b, c))


n = int(input())
for i in range(n):
	print(sum([int(i) for i in input().split(' ')]) // 2)


n = int(input())
results = []
for i in range(0, n):
	s = sum([int(x) for x in input().split(' ')])
	results.append(s // 2)
for i in results:
	print(i)


n = int(input())
while n:
	(a, b, c) = map(int, input().split())
	x = c - abs(a - b)
	print(max(a, b) + x // 2)
	n -= 1


q = int(input())
while q > 0:
	print(sum(map(int, input().split())) // 2)
	q -= 1


T = int(input())
for i in range(T):
	candies = [int(y) for y in input().split()]
	candies.sort()
	a = candies[0]
	b = candies[1]
	a = a + (candies[1] - candies[0])
	ostalo = candies[2] - candies[1] + candies[0]
	print(a + ostalo // 2)


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	ls = sorted((a, b, c))
	x = ls[0]
	y = ls[1]
	z = ls[2]
	diff = abs(x - y)
	if z >= diff:
		z = z - diff
		print(y + z // 2)
	else:
		print(x + z)


from math import floor
for _ in range(int(input())):
	l = [int(x) for x in input().split()]
	count = 0
	o = 0
	for i in l:
		if i % 2 == 0:
			count += int(i // 2)
		else:
			count += int(i // 2)
			o += 1
	count += int(o / 2)
	print(count)


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : li(ent())
q = iinp()
res = []
for i in range(q):
	(a, b, c) = ent()
	suma = (a + b + c) // 2
	res.append(suma)
for i in res:
	print(i)


def f(a, b, c):
	if b > a:
		(a, b) = (b, a)
	c -= a - b
	if c >= 0:
		b += c // 2 + (a - b)
		a = b
	else:
		b += c + (a - b)
		a = b
	return a
q = int(input())
for i in range(q):
	mas = list(map(int, input().split()))
	ans = max(f(mas[0], mas[1], mas[2]), f(mas[0], mas[2], mas[1]), f(mas[1], mas[2], mas[0]))
	print(ans)


n = int(input())
for i in range(n):
	(a, b, c) = [int(x) for x in input().split()]
	if abs(a - b) <= c or abs(b - c) <= a or abs(c - a) <= b:
		print((a + b + c) // 2)
	else:
		print(min[a + b, b + c, c + a])


n = int(input())
(l, k) = ([], 0)
for _ in range(n):
	a = list(map(int, input().split()))
	for i in range(3):
		k += a[i]
	l.append(k // 2)
	l.append(' ')
	k = 0
for j in range(len(l)):
	if l[j] != ' ':
		print(l[j])


def candie(liste=[]):
	if sum(liste) % 2 == 0:
		return sum(liste) // 2
	else:
		return (sum(liste) - 1) // 2
q = int(input())
liste2 = []
for i in range(q):
	liste1 = [int(i) for i in input().split()]
	liste2.append(liste1)
for i in liste2:
	print(candie(i))


n = int(input())
piles = []
for i in range(n):
	aux = [int(x) for x in input().split()]
	piles.append(aux)
for i in range(len(piles)):
	print(sum(piles[i]) // 2)


from itertools import permutations
for _ in range(int(input())):
	a = list(map(int, input().split()))
	ans = 0
	for p in permutations(a):
		(x, y) = (p[0], p[1])
		if x > y:
			(x, y) = (y, x)
		d = min(y - x, p[2])
		x += d
		x += (p[2] - d) // 2
		y += (p[2] - d) // 2
		ans = max(ans, min(x, y))
	print(ans)


for i in range(int(input())):
	b = list((int(x) for x in input().split()))
	sum = 0
	for i in b:
		sum += i
	print(sum // 2)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	k = a + b + c
	p = k // 2
	print(p)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	a.sort()
	t = a[0]
	s = a[1]
	p = (a[2] + s - t) // 2 + a[0]
	q = (a[2] + t - s) // 2 + a[1]
	print(min(p, q))


import math
q = int(input())
while q:
	l = list(map(int, input().split()))
	l = sorted(l)
	a = l[0]
	b = l[1]
	c = l[2]
	r = 0
	r = (a + b + c) // 2
	print(r)
	q -= 1


def sint():
	return int(input())

def sints():
	return map(int, input().split())

def sara():
	return list(map(int, input().split()))

def sstr():
	s = input()
	return list(s[:len(s)])

def main():
	t = sint()
	while t:
		t -= 1
		(a, b, c) = sints()
		print((a + b + c) // 2)
main()


for i in range(int(input())):
	lis = [0] * 3
	(lis[0], lis[1], lis[2]) = map(int, input().split())
	lis.sort()
	dif = lis[1] - lis[0]
	ans = (lis[2] - dif) // 2 + lis[1]
	print(ans)


for s in [*open(0)][1:]:
	(x, y, z) = sorted(map(int, s.split()))
	print((x + y + z) // 2)


import math

def main():
	q = int(input())
	for _ in range(q):
		arr = list(map(int, input().split()))
		arr.sort()
		a = arr[0]
		b = arr[1]
		c = arr[2]
		d = min(b - a, c)
		a += d
		c -= d
		a += c // 2
		print(a)
main()


n = int(input())
nums = []
for i in range(n):
	inp = input().split()
	(inp[0], inp[1], inp[2]) = (int(inp[0]), int(inp[1]), int(inp[2]))
	if inp[0] + inp[1] + inp[2] % 2 is 1:
		nums.append((inp[0] + inp[1] + inp[2] - 1) // 2)
	else:
		nums.append(int((inp[0] + inp[1] + inp[2]) // 2))
for i in range(n):
	print(nums[i])


t = int(input())
for _ in range(t):
	list1 = sorted(list(map(int, input().split())))
	k = list1[1] - list1[0]
	list1[2] -= k
	print(list1[1] + list1[2] // 2)


T_T = int(input().strip())
while T_T:
	T_T = T_T - 1
	a = list(map(int, input().strip().split()))
	sum = a[0] + a[1] + a[2]
	ans = 0
	for i in range(3):
		a = a[1:] + a[:1]
		if a[0] >= abs(a[1] - a[2]):
			ans = sum >> 1
			break
		else:
			ans = max(ans, a[0] + min(a[1], a[2]))
	print(ans)


q = int(input())
for i in range(0, q):
	x = list(map(int, input().split(' ')))
	print(sum(x) // 2)


q = int(input())
for i in range(q):
	p = list(map(int, input().split()))
	A = p[0]
	B = p[1]
	C = p[2]
	print((A + B + C) // 2)


q = int(input())
t = []
answer = []
for i in range(q):
	temp = input()
	t = temp.split()
	t.sort()
	(a, b, c) = (int(t[0]), int(t[1]), int(t[2]))
	c = c - b + a
	answer.append(b + c // 2)
for i in range(len(answer)):
	print(answer[i])


from sys import stdin, stdout
ans = []
for q in stdin.readlines()[1:]:
	A = list(map(int, q.split()))
	ans.append(0)
	for i in range(3):
		a = A[i]
		b = A[(i + 1) % 3]
		c = A[(i + 2) % 3]
		d = abs(a - b)
		if c >= d:
			a = b = max(a, b)
			c -= d
			a += c // 2
		else:
			if a < b:
				a += c
			else:
				b += c
			a = min(a, b)
		ans[-1] = max(ans[-1], a)
print('\n'.join((str(i) for i in ans)))


a = int(input())
ans = []
for i in range(0, a):
	b = input()
	c = [int(x) for x in b.split()]
	ans.append((c[0] + c[1] + c[2]) // 2)
for j in range(0, a):
	print(ans[j])


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	abc = linput()
	abc.sort()
	ext = abc[2] - (abc[1] - abc[0])
	print(abc[1] + ext // 2)


x = int(input())
while x:
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = 0
	print(int((a + b + c) // 2))
	x -= 1


from math import floor
q = int(input())
for i in range(q):
	(a, b, c) = list(map(int, input().split()))
	print((a + b + c) // 2)


from sys import stdin
from itertools import permutations
q = int(stdin.readline())
for i in range(q):
	(x, y, z) = map(int, stdin.readline().split())
	print((x + y + z) // 2)


def three_piles(arr, n):
	return sum(arr) // 2
q = int(input())
while q:
	arr = list(map(int, input().rstrip().split()))
	print(three_piles(arr, len(arr)))
	q = q - 1


q = int(input())
while q > 0:
	q -= 1
	arr = [int(x) for x in input().split()]
	total = sum(arr)
	print(total // 2)


q = int(input())
while q != 0:
	q = q - 1
	a = [int(i) for i in input().split()]
	print(sum(a) // 2)


for _ in range(int(input())):
	A = list(map(int, input().split()))
	A.sort()
	a = A[1]
	b = A[0]
	d = a - b
	A[2] -= d
	ans = a + A[2] // 2
	print(ans)


import math
tst = int(input())
for i in range(tst):
	a = list(map(int, input().split()))
	a.sort()
	print((a[0] + a[1] + a[2]) // 2)


m = int(input())
c = 0
k = 0
L = []
while c != m:
	a = [int(el) for el in input().split()]
	L.append((sum(a) - sum(a) % 2) // 2)
	c += 1
for i in range(len(L)):
	print(L[i])


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	(aa, bb, cc) = (abs(a - b), abs(b - c), abs(a - c))
	if aa <= bb and aa <= cc:
		print(max(a, b) + (c - aa) // 2)
	elif bb <= aa and bb <= cc:
		print(max(b, c) + (a - bb) // 2)
	else:
		print(max(c, a) + (b - cc) // 2)


import math
n = int(input())
while n:
	(a, b, c) = input().split()
	print(math.floor((int(a) + int(b) + int(c)) // 2))
	n -= 1


import os
import math
import operator
import sys
from collections import defaultdict
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		sm = a + b + c
		print(sm // 2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
i = 0
while i < t:
	p = list(map(int, input().split()))
	print(sum(p) // 2)
	i += 1


def candle(a, b, c):
	numlist = [a, b, c, a, b]
	sumlist = [0, 0, 0]
	for i in range(3):
		sumlist[i] = min(max(numlist[i], numlist[i + 1]) + (numlist[i + 2] - abs(numlist[i] - numlist[i + 1])) // 2, min(numlist[i], numlist[i + 1]) + (numlist[i + 2] + abs(numlist[i] - numlist[i + 1])) // 2)
	return max(sumlist)
num = int(input())
list1 = list(range(num))
for i in range(num):
	x = input()
	list1[i] = [int(y) for y in x.split()]
for j in list1:
	print(candle(j[0], j[1], j[2]))


n = int(input())
for i in range(n):
	raw_in = input().split()
	querry = [int(x) for x in raw_in]
	sum_querry = sum(querry)
	print(sum_querry // 2)


q = int(input())
for i in range(q):
	a = list(map(int, input().split()))
	a.sort()
	d = a[1] - a[0]
	a[2] -= d
	ans = a[1] + a[2] // 2
	print(ans)


for case in range(int(input())):
	print(sum([int(x) for x in input().split()]) // 2)


t = int(input())
for _ in range(t):
	(a, b, c) = [int(i) for i in input().split()][:3]
	print((a + b + c) // 2)


for tc in [0] * int(input()):
	print(sum(map(int, input().split())) >> 1)


for i in range(int(input())):
	a = list(input().split())
	b = [int(j) for j in a]
	print(sum(b) // 2)


n = int(input())
a = []
for i in range(n):
	(p, q, r) = map(int, input().split()[:3])
	a.append((p + q + r) // 2)
for i in a:
	print(i)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	d = abs(a - b)
	if a < b:
		a = a + d
	else:
		b = b + d
	c = c - d
	f = c // 2
	print(f + a)


ans = list()
n = int(input())
for i in range(0, n):
	(x, y, z) = [int(x) for x in input().split()]
	ans = ans + [(x + y + z) // 2]
for i in range(0, n):
	print(ans[i])


t = int(input().strip())
for i in range(t):
	nums = [int(i) for i in input().strip().split()]
	total = sum(nums)
	print(total // 2)


def three_numbers():
	numbers = list(map(int, input().split(sep=' ')))
	m = max(numbers)
	for i in numbers:
		if i != m:
			print(m - i, end=' ')

def gen_and_card_game():
	card = input()
	my_cards = list(input().split(sep=' '))
	for i in my_cards:
		if i[0] == card[0] or i[1] == card[1]:
			print('YES')
			break
	else:
		print('NO')

def kazak_vus_and_contest():
	(a, b, c) = map(int, input().split(sep=' '))
	if a - b <= 0 and a - c <= 0:
		print('YES')
	else:
		print('NO')

def like_A():
	st = input()
	count_a = 0
	for i in st:
		if i == 'a':
			count_a += 1
	if count_a > len(st) - count_a:
		print(len(st))
	else:
		print(count_a + count_a - 1)

def three_piece_candies():
	n = int(input())
	for i in range(n):
		(a, b, c) = map(int, input().split(sep=' '))
		print((a + b + c) // 2)
three_piece_candies()


q = int(input())
if q >= 1 and q <= 1000:
	a = []
	for i in range(q):
		p = list(map(int, input().split()))
		p.sort()
		if sum(p) >= 3:
			x = (p[2] + p[1] - p[0]) // 2
			if x + p[0] == p[1] + p[2] - x:
				a.append(x + p[0])
			elif x + p[0] > p[1] + p[2] - x:
				a.append(x + p[0] - 1)
			elif x + p[0] < p[1] + p[2] - x:
				a.append(x + p[0])
	for j in a:
		print(j)


d = int(input())
for i in range(0, d):
	a = input().split(' ')
	(x, y, z) = (int(a[0]), int(a[1]), int(a[2]))
	print((x + y + z) // 2)


for tc in range(int(input())):
	piles = [int(i) for i in input().split()]
	piles.sort()
	a = piles[0]
	b = piles[1]
	c = piles[2]
	if a < b:
		c -= b - a
		a += b - a
	elif a > b:
		c -= a - b
		b += a - b
	a += c // 2
	print(a)


q = int(input())
for i in range(q):
	(a, b, c) = map(int, input().split())
	o = [a, b, c]
	o.sort()
	(alice, bob) = (o[0], o[1])
	dif = bob - alice
	c = o[2]
	c -= dif
	c //= 2
	print(bob + c)


from sys import stdin

def main():
	casos = int(stdin.readline().strip())
	while casos > 0:
		(a, b, c) = [int(x) for x in stdin.readline().strip().split()]
		result = (a + b + c) // 2
		print(result)
		casos = casos - 1
main()


import sys
import os
from io import IOBase, BytesIO
import math
import collections
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	lst = []
	for p in range(n + 1):
		if prime[p]:
			lst.append(p)
	return lst

def nCr(n, r):
	a = 1
	b = 1
	c = 1
	for i in range(1, n + 1):
		c *= i
	for i in range(1, r + 1):
		b *= i
	for i in range(1, n - r + 1):
		a *= i
	return c // (a * b)

def sieveOfEratosthenes1(N, s):
	prime = [False] * (N + 1)
	for i in range(2, N + 1, 2):
		s[i] = 2
	for i in range(3, N + 1, 2):
		if prime[i] == False:
			s[i] = i
			for j in range(i, int(N / i) + 1, 2):
				if prime[i * j] == False:
					prime[i * j] = True
					s[i * j] = i

def generatePrimeFactors(N):
	s = [0] * (N + 1)
	sieveOfEratosthenes1(N, s)
	curr = s[N]
	cnt = 1
	factors = []
	power = []
	while N > 1:
		N //= s[N]
		if curr == s[N]:
			cnt += 1
			continue
		factors.append(curr)
		power.append(cnt)
		curr = s[N]
		cnt = 1
	return (factors, power)

def main():
	for _ in range(int(sin())):
		(a, b, c) = map(int, sin().split())
		print((a + b + c) // 2)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


for _ in [0] * int(input()):
	(a, b, c) = sorted(map(int, input().split()))
	print(b + (a + c - b) // 2)


from sys import stdin
input = stdin.readline
q = int(input())
for i in range(q):
	[a, b, c] = [int(item) for item in input().split(' ')]
	print((a + b + c) // 2)


from sys import stdin, stdout
import sys
import math
t = int(stdin.readline())
for i in range(t):
	a = list(map(int, stdin.readline().split()))
	print(sum(a) // 2)


mikey = int(input())
for matthew in range(mikey):
	num = sum(list(map(int, input().split())))
	print(num // 2)


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	for x in range(3):
		for y in range(3):
			if x != y:
				z = 3 - (x + y)
				(a, b) = (l[x] + (l[z] - l[x] + l[y]) // 2, l[y] + (l[z] - l[y] + l[x]) // 2)
	print(min(a, b))


q = int(input())
for _ in range(q):
	pile = list(map(int, input().split()))
	ans = (pile[0] + pile[1] + pile[2]) // 2
	print(ans)


n = int(input())
for i in range(n):
	l = list(map(int, input().strip().split()))
	s = sum(l)
	print(s // 2)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	n = sum(l) // 2
	print(n)


q = int(input())
for i in range(0, q):
	S = list(map(int, input().split()))
	if S[0] >= S[1] and S[0] >= S[2]:
		max = S[0]
	if S[1] >= S[0] and S[1] >= S[2]:
		max = S[1]
	if S[2] >= S[1] and S[2] >= S[0]:
		max = S[2]
	S.pop(S.index(max))
	Alice = S[0]
	Bob = S[1]
	if max < abs(Bob - Alice):
		print(min(S) + max)
	else:
		print((sum(S) + max) // 2)


for i in range(int(input())):
	X = sorted(list(map(int, input().split())))
	A = X[0]
	B = X[1]
	X[2] -= X[1] - X[0]
	print(B + X[2] // 2)


x = int(input())
for i in range(x):
	nums = input().split()
	a = int(nums[0])
	b = int(nums[1])
	c = int(nums[2])
	val = (a + b + c) // 2
	print(val)


t = int(input())
output = []
for i in range(t):
	(a, b, c) = map(int, input().split())
	d = (a + b + c) // 2
	output.append(d)
for i in output:
	print(i)


t = int(input())
l = []
for i in range(t):
	a = input().split(' ')
	a = list(map(int, a))
	a.sort()
	diff = a[1] - a[0]
	ex = a[2] - diff
	al = ex // 2 + a[0] + diff
	l.append(al)
for j in l:
	print(j)


n = int(input())
for item in range(n):
	print(sum(list(map(int, input().split()))) // 2)


T = int(input())
for i1 in range(T):
	s = input()
	s1 = s.split(' ')
	i = 0
	for j in range(len(s1)):
		i = i + int(s1[j])
	print(i // 2)


import math

def distribute_candies(candies):
	(frac, whole) = math.modf(sum(candies) / 2)
	if frac > 0.5:
		print(math.ceil(sum(candies) / 2))
	else:
		print(sum(candies) // 2)
queries = int(input())
for i in range(queries):
	candies = list(map(lambda x: int(x), input().split()))
	distribute_candies(candies)


case = int(input())
for caseNum in range(0, case):
	(a, b, c) = [int(x) for x in input().split()]
	print((a + b + c) // 2)


def candy(x, y, z):
	return (x + y + z) // 2
Z = []
p = int(input())
for i in range(p):
	x = input()
	(a, b, c) = x.split()
	a = int(a)
	b = int(b)
	c = int(c)
	Z.append(candy(a, b, c))
for i in range(len(Z)):
	print(Z[i])


for _ in range(int(input())):
	l = [int(i) for i in input().split()]
	l.sort(reverse=1)
	mini = 10 * 100
	ind1 = -1
	n = 3
	ind2 = -1
	for i in range(n - 1):
		if l[i + 1] - l[i] < mini:
			mini = l[i + 1] - l[i]
			ind1 = i + 1
			ind2 = i
	for i in range(n):
		if i != ind1 and i != ind2:
			ind3 = i
	a = l[ind1]
	b = l[ind2]
	c = l[ind3]
	if c < a - b:
		print(c + b)
	else:
		d = a - b
		c = c - d
		print(a + c // 2)


from sys import stdin
n = int(stdin.readline().strip())
for i in range(n):
	s = list(map(int, stdin.readline().strip().split()))
	s.sort()
	a = s[0]
	b = s[1]
	d = b - a
	c = s[2]
	y = min(c, d)
	a += y
	c -= y
	a += c // 2
	print(a)


q = int(input())
for _ in range(q):
	a = list(map(int, input().split()))
	a.sort()
	d = a[1] - a[0]
	a[2] -= d
	print(a[1] + a[2] // 2)


a = int(input())
arr = []
for i in range(a):
	m = list(input().split())
	arr.append(m)
s = 0
for i in arr:
	s = int(i[0]) + int(i[1]) + int(i[2])
	print(s // 2)


q = int(input())
l = []
for i in range(q):
	(a, b, c) = map(int, input().split())
	abc = sorted([a, b, c])
	o = abc[0] + (abc[1] - abc[0])
	t = abc[1]
	abc[2] -= abc[1] - abc[0]
	o += abc[2] // 2
	t += abc[2] // 2
	l.append(o)
for i in l:
	print(i)


import sys
import os
from io import IOBase, BytesIO

def main():
	for tc in range(int(input())):
		arr = get_array()
		ans = 0
		for i in range(3):
			(a, b) = (0, 0)
			(p, q, r) = (0, 0, 0)
			p = i
			for j in range(3):
				if j != i and q == 0:
					q = j
					break
			for j in range(3):
				if j != i and j != q:
					r = j
					break
			a = arr[q]
			b = arr[r]
			if a <= b:
				if a + arr[p] <= b:
					a += arr[p]
					ans = max(ans, a)
				else:
					arr[p] -= b - a
					b += arr[p] // 2
					ans = max(ans, b)
			else:
				(b, a) = (a, b)
				if a + arr[p] <= b:
					a += arr[p]
					ans = max(ans, a)
				else:
					arr[p] -= b - a
					b += arr[p] // 2
					ans = max(ans, b)
		print(ans)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip()
main()


n = int(input())
lst = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	sum = a + b + c
	result = sum // 2
	lst.append(result)
for e in lst:
	print(e)


max_candies = lambda List: List[1] + (List[2] + List[0] - List[1]) // 2
for _ in [0] * int(input()):
	print(max_candies(sorted([int(i) for i in input().split()])))


for i in range(int(input())):
	x = list(map(int, input().split()))
	x.sort()
	w = (x[-1] - (x[1] - x[0])) // 2
	print(w + max(x[0], x[1]))


import sys

def db(*arg):
	print(*arg)
Q = int(input())
ans_ls = [0] * Q
for q in range(Q):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	ans_ls[q] = s // 2
print(*ans_ls, sep='\n')


from sys import stdin
nq = stdin.readline()
for x in range(int(nq)):
	l = list(map(int, stdin.readline().split(' ')))
	l.sort()
	diff = l[1] - l[0]
	if diff >= l[2]:
		print(l[0] + diff)
	else:
		print(l[0] + diff + (l[2] - diff) // 2)


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
for i in range(n):
	(a, b, c) = f()
	print((a + b + c) // 2)


t = int(input())
while t > 0:
	n = list(map(int, input().split()))
	y = sum(n)
	print(y // 2)
	t = t - 1


n = int(input())
for i in range(n):
	t = input().split(' ')
	t = [int(j) for j in t]
	t.sort()
	if t[0] + t[2] < t[1]:
		print(t[0] + t[2])
	else:
		t[2] -= t[1] - t[0]
		print(t[1] + t[2] // 2)


def split_candies(piles):
	piles = sorted(piles)
	(first, second, third) = piles
	if first + second == third:
		alice = third
	else:
		bobLess = second - first
		alice = second + (third - bobLess) // 2
	print(alice)
n = int(input())
for _ in range(n):
	piles = input().split(' ')
	piles = list(map(lambda p: int(p), piles))
	split_candies(piles)


def call():
	(n, m, k) = map(int, input().split())
	print((n + m + k) // 2)
for i in range(int(input())):
	call()


for _ in range(int(input())):
	a = list(map(int, input().split()))
	s = sum(a)
	if s % 2 == 0:
		print(s // 2)
	else:
		print((s - 1) // 2)


inp = int(input())
for x in range(inp):
	inp2 = sum(list(map(int, input().split()))) // 2
	print(inp2)


n = int(input())
for i in range(n):
	a_b_c = list(map(int, input().split(' ')))
	a_b_c.sort()
	(a, b, c) = a_b_c
	if a != b:
		c -= b - a
		print(b + c // 2)
	else:
		print(b + c // 2)


n = int(input())
for i in range(n):
	temp = input().split(' ')
	temp[0] = int(temp[0])
	temp[1] = int(temp[1])
	temp[2] = int(temp[2])
	p1 = min(temp[0], temp[1], temp[2])
	temp.remove(p1)
	p2 = min(temp[0], temp[1])
	temp.remove(p2)
	num = temp[0]
	diff = p2 - p1
	num = num - diff
	print(p2 + num // 2)


from decimal import Decimal
q = int(input())
while q > 0:
	q -= 1
	(x, y, z) = map(int, input().split(' '))
	ans = int(Decimal(x + y + z) / 2)
	print(ans)


import math
t = int(input())
while t > 0:
	(x, y, z) = [int(x) for x in input().split()]
	print((x + y + z) // 2)
	t = t - 1


n = int(input())
for x in range(n):
	m = list(map(int, input().split()))
	m.sort()
	m[2] += m[0]
	if m[2] - m[1] <= 0:
		print(m[2])
	else:
		g = m[2] - m[1]
		m[0] = m[1] + g // 2
		print(m[0])


for i in range(int(input())):
	print(sum([int(u) for u in input().split()]) // 2)


q = int(input())
while q > 0:
	li = list(map(int, input().split()))
	if (li[0] + li[1]) % 2 == 1:
		x = (li[0] + li[1]) // 2
		if li[2] % 2 == 1:
			x = x + li[2] // 2 + 1
		else:
			x = x + li[2] // 2
	else:
		x = (li[0] + li[1] + li[2]) // 2
	print(x)
	q = q - 1


q = int(input(''))
n = []
for i in range(q):
	s = input().split(' ')
	n.append((int(s[0]) + int(s[1]) + int(s[2])) // 2)
for i in range(q):
	print(n[i])


t = int(input())
for i in range(t):
	arr = []
	(a, b, c) = map(int, input().split())
	arr.append(a)
	arr.append(b)
	arr.append(c)
	arr.sort()
	y = int((arr[0] + arr[2] - arr[1]) / 2)
	ans = arr[1] + y
	ans1 = arr[0] + arr[2] - y
	print(min(ans, ans1))


def main():
	q = int(input())
	for _ in range(q):
		piles = [int(i) for i in input().split()]
		print(sum(piles) // 2)
main()


a = int(input())
res = 0
K = []
while res != a:
	res += 1
	L = [int(el) for el in input().split()]
	K.append(sum(L) // 2)
for i in range(len(K)):
	print(K[i])


import sys
n_cases = int(sys.stdin.readline())
for i in range(n_cases):
	values = [int(i) for i in sys.stdin.readline().split()]
	(max_index, max_val) = (None, None)
	sorted_vals = sorted(values)
	print(sorted_vals[1] + (sorted_vals[2] - (sorted_vals[1] - sorted_vals[0])) // 2)


t = int(input())
for x in range(t):
	candies = list(map(int, input().split(None, 3)[:3]))
	print((candies[0] + candies[1] + candies[2]) // 2)


q = int(input())
res = []
for _ in range(q):
	(a, b, c) = map(int, input().split())
	total = a + b + c
	ans = total // 2
	res.append(ans)
for i in res:
	print(i)


q = int(input())
a = []
for i in range(0, q):
	total = 0
	x = input()
	z = x.split()
	total = int(z[0]) + int(z[1]) + int(z[2])
	if total % 2 == 0:
		total = total // 2
		a.append(int(total))
	else:
		total = total - 1
		total = total // 2
		a.append(int(total))
for i in range(0, q):
	print(a[i])


for i in range(int(input())):
	data = [int(j) for j in input().split()]
	data.sort()
	a = data[0]
	b = data[1]
	dif = b - a
	if data[2] > dif:
		mx = b + (data[2] - dif) // 2
	else:
		mx = a + data[2]
	a = data[1]
	b = data[2]
	dif = b - a
	if data[0] > dif:
		mx = max(mx, b + (data[0] - dif) // 2)
	else:
		mx = max(mx, a + data[0])
	print(mx)


from itertools import permutations
n = int(input())
for _ in range(n):
	tot = sum(map(int, input().split()))
	print(tot // 2)


arr = []
b = 0
q = int(input())
for y in range(q):
	yy = [int(g) for g in input().split(' ')]
	yy.sort()
	k = yy[1] - yy[0]
	l = yy[0] + k
	p = yy[2] - k
	p = int(p // 2)
	print(int(l + p))


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		(a, b, c) = ain()
		print((a + b + c) // 2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def find_middle(arr, n=3):
	mid = 0
	for i in range(n):
		mid += arr[i]
	if mid % 2 != 0:
		mid -= 1
	mid //= 2
	return mid
n = int(input(''))
arr = []
for i in range(0, n):
	n = list(map(int, input().split(' ')))
	arr.append(n)
for j in range(0, len(arr)):
	print(int(find_middle(arr[j])))


q = int(input())
for qq in range(q):
	abc = input().split()
	a = int(abc[0])
	b = int(abc[1])
	c = int(abc[2])
	div = a
	l = min(b, c)
	r = max(b, c)
	dif = r - l
	if div >= dif:
		div = a - dif
		m1 = r + div // 2
	else:
		m1 = l + div
	div = b
	l = min(a, c)
	r = max(a, c)
	dif = r - l
	if div >= dif:
		div = b - dif
		m2 = r + div // 2
	else:
		m2 = l + div
	div = c
	l = min(b, a)
	r = max(b, a)
	dif = r - l
	if div >= dif:
		div = c - dif
		m3 = r + div // 2
	else:
		m3 = l + div
	print(max(m1, m2, m3))


import math
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	s = a + b + c
	print(s // 2)


queries = int(input())
for i in range(0, queries):
	candy = input().split(' ')
	total = 0
	for p in range(0, len(candy)):
		total += int(candy[p])
	print(total // 2)


n = int(input())
for i in range(n):
	sum1 = 0
	l = list(map(int, input().split()))
	for j in l:
		sum1 += j
	print(sum1 // 2)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans1 = min(a, b) + max(a, b) - min(a, b) + (c - (max(a, b) - min(a, b))) // 2
	ans2 = min(a, c) + max(a, c) - min(a, c) + (b - (max(a, c) - min(a, c))) // 2
	ans3 = min(c, b) + max(c, b) - min(c, b) + (a - (max(c, b) - min(c, b))) // 2
	print(max(ans1, ans2, ans3))


for case in range(int(input())):
	l1 = input().split()
	sum = 0
	for i in range(3):
		l1[i] = int(l1[i])
		sum += l1[i]
	print(sum // 2)