import sys
from decimal import Decimal

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 ** 10
MOD = 10 ** 9 + 7
EPS = 10 ** -10

def bisearch_max(mn, mx, func):
    ok = mn
    ng = mx
    while ok+1 < ng:
        mid = (ok+ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

# m*2+1回カップを入れた時、温度がt以上かどうか
def check(m):
    res = (h*(m+1) + c*m) / (m*2+1)
    return res >= t

for _ in range(INT()):
    h, c, t = map(Decimal, input().split())

    ev = (h+c) / 2
    res = bisearch_max(0, INF, check)
    if res == INF-1:
        print(2)
    else:
        mn = INF
        ans = -1
        for m in range(max(res-10, 0), res+10):
            res = (h*(m+1) + c*m) / (m*2+1)
            diff = abs(res - t)
            if diff < mn:
                mn = diff
                ans = m*2 + 1
        print(ans)


import math

def main(th, tc, t):
    count = 1
    get = 0
    if t == th/2 or t == tc/2:
        return 1
    elif (th + tc) == 2 * t:
        return 2
    else:
        val = (t - th)/ (tc + th - (2 * t))
        #print(val)
        val = math.ceil(val)
        if val < 0:
            return 2
        #print(((th + tc)/2), (((val*tc) + ((val+1)*th))/ (val + val + 1)))
        #if abs(t - ((th + tc)/2)) < abs(t - (((val*tc) + ((val+1)*th))/ (val + val + 1))):
         #   return 2
        return  val + val + 1

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]

    print(main(th, tc, t))


def main(th, tc, t):
    if t == th/2:
        return 1
    elif (th + tc)/2 >= t:
        return 2
    else:
        count = [0, 10**6]
        log =[None, None]
        while True:
            mid = (count[0] + count[1]) //2
            if mid in log:
                return (min(count) * 2)+1
            val = ((mid*tc) + ((mid + 1)*th)) / ((mid + 1)+mid)

            if val < t:
                count[1] = mid
            elif val > t:
                count[0] = mid

            if len(log) == 2:
                log = [log[1]] + [mid]

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]
    print(main(th, tc, t))


def main(th, tc, t):
    count = 1
    get = 0
    if (th + tc) == 2 * t:
        return 2
    else:
        val = (t - th)/ (tc + th - (2 * t))
        return  round(val) + round(val + 1)

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]

    print(main(th, tc, t))


import math
def mix(h, c, t):
    if(h+c >= t*2): return 2
    cnt = (t-c)/(t*2 - h - c)
    x = int(cnt)
    y = math.ceil(cnt)
    m = (x*h + (x-1)*c) / (2*x-1)-t
    n = (y*h + (y-1)*c) / (2*y-1)-t
    if abs(m) > abs(n): ans = y;
    else: ans = x
    return ans*2-1

for _ in range(int(input())):
	h, c, t = [int(x) for x in input().split()]
	print(mix(h,c,t))


import math
from decimal import Decimal as d

def calcT(th, tc, n):
    return (d((tc * n)) + ((n+1) * th)) / ((2*n) + 1) # Added Decimal function

def main(th, tc, t):
    if (th + tc)/2 >= t: return 2
    else:
        n = (t - th)/(tc + th - (2 * t))
        # Comparing the ceil and floor values of n
        if abs(t - calcT(th, tc, math.ceil(n))) < abs(t - calcT(th, tc, math.floor(n))):
            return (math.ceil(n) * 2) + 1
        return (math.floor(n) * 2) + 1

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]
    print(main(th, tc, t))


def main(th, tc, t):
    if t == th:
        return 1
    elif (th + tc)/2 >= t:
        return 2
    else:
        count = [0, 10**6]
        log =[None, None]
        while True:
            mid = (count[0] + count[1]) //2
            if mid in log:
                min1 = min(count)
                max1 = max(count)
                val1 = ((min1*tc) + ((min1 + 1)*th)) / ((min1 + 1)+min1)
                val2 = ((max1*tc) + ((max1 + 1)*th)) / ((max1 + 1)+max1)
                if abs(t - val1) <= abs(t-val2):
                    return (min1 * 2) + 1
                else:
                    return (max1 * 2) + 1
            val = ((mid*tc) + ((mid + 1)*th)) / ((mid + 1)+mid)

            if val < t:
                count[1] = mid
            elif val > t:
                count[0] = mid

            if len(log) == 2:
                log = [log[1]] + [mid]

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]
    print(main(th, tc, t))


import math

def main(th, tc, t):
    count = 1
    get = 0
    if t == th/2 or t == tc/2:
        return 1
    elif (th + tc) == 2 * t:
        return 2
    else:
        val = (t - th)/ (tc + th - (2 * t))
        print(val)
        val = math.ceil(val)
        if val < 0:
            return 2
        #print(((th + tc)/2), (((val*tc) + ((val+1)*th))/ (val + val + 1)))
        #if abs(t - ((th + tc)/2)) < abs(t - (((val*tc) + ((val+1)*th))/ (val + val + 1))):
         #   return 2
        return  val + val + 1

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]

    print(main(th, tc, t))


import math
def calcT(th, tc, n):
    return ((tc * n) + ((n+1) * th)) / ((2*n) + 1)

def main(th, tc, t):
    if (th + tc)/2 >= t: return 2
    else:
        n = (t - th)/(tc + th - (2 * t))
        if abs(t - calcT(th, tc, math.ceil(n))) < abs(t - calcT(th, tc, math.floor(n))):
            return (math.ceil(n) * 2) + 1
        return (math.floor(n) * 2) + 1

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]
    print(main(th, tc, t))


def main(th, tc, t):
    count = 1
    get = 0
    if t == th/2 or t == tc/2:
        return 1
    elif (th + tc) == 2 * t:
        return 2
    else:
        val = (t - th)/ (tc + th - (2 * t))
        val = round(val)
        if val < 0:
            return 2
        #print(((th + tc)/2), (((val*tc) + ((val+1)*th))/ (val + val + 1)))
        #if abs(t - ((th + tc)/2)) < abs(t - (((val*tc) + ((val+1)*th))/ (val + val + 1))):
         #   return 2
        return  val + val + 1

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]

    print(main(th, tc, t))


import math
def mix(h, c, t):
    if(h+c >= t*2): return 2
    cnt = (t-c)/(t*2 - h - c)
    x = int(cnt)
    y = math.ceil(cnt)
    m = (x*h + (x-1)*c) / (2*x-1)
    n = (y*h + (y-1)*c) / (2*y-1)
    if abs(m) > abs(n): ans = y;
    else: ans = x
    return ans*2-1

for _ in range(int(input())):
	h, c, t = [int(x) for x in input().split()]
	print(mix(h,c,t))


import math

def main(th, tc, t):
    count = 1
    get = 0
    if (th + tc) == 2 * t:
        while get/count != t:
            get += th + tc
            if count == 1:
                count += 1
            else:
                count += 2
        return count
    else:
        val = (t - th)/ (tc + th - (2 * t))
        return  math.ceil(val) + math.ceil(val + 1)

for _ in range(int(input())):
    th, tc, t = [int(i) for i in input().split()]

    print(main(th, tc, t))


"""
NTC here
"""

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from decimal import Decimal, getcontext
getcontext().prec = 8

def iin(): return int(input())

def lin(): return list(map(Decimal, input().split()))

from types import GeneratorType

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

    return wrappedfunc

def main():

    T = iin()
    for _ in range(T):
        h, c, t = lin()
        ans = [[abs(h-t), 1]]
        md = (h+c)/2
        ans.append([abs(md-t), 2])
        if md<t:
            l, r = Decimal(1), Decimal(10**6)
            ch = 0
            while l<r:
                if ch>5:break
                x = (l+r)//2
                x1 = 2*x -1
                a1 = (x*h+(x-1)*c)/x1
                ans.append([abs(a1-t), x1])
                if a1<t:
                    r = x
                elif a1>t:
                    l = x
                else:
                    break
                if r-l<=1:
                    ch += 1
        ans.sort()
        mn =ans[0]
        # print(ans)
        print(mn[1])

# region fastio

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")

# endregion

if __name__ == "__main__":
    main()


"""
NTC here
"""

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from decimal import Decimal, getcontext
getcontext().prec = 40

def iin(): return int(input())

def lin(): return list(map(Decimal, input().split()))

from types import GeneratorType

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

    return wrappedfunc

def main():

    T = iin()
    for _ in range(T):
        h, c, t = lin()
        ans = [[abs(h-t), 1]]
        md = (h+c)/2
        ans.append([abs(md-t), 2])
        if md<t:
            l, r = Decimal(1), Decimal(10**6)
            ch = 0
            while l<r:
                if ch>5:break
                x = (l+r)//2
                x1 = 2*x -1
                a1 = (x*h+(x-1)*c)/x1
                ans.append([abs(a1-t), x1])
                if a1<t:
                    r = x
                elif a1>t:
                    l = x
                else:
                    break
                if r-l<=1:
                    ch += 1
        ans.sort()
        mn =ans[0]
        # print(ans)
        print(mn[1])

# region fastio

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")

# endregion

if __name__ == "__main__":
    main()


"""
NTC here
"""

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
from decimal import Decimal, getcontext
getcontext().prec = 15

def iin(): return int(input())

def lin(): return list(map(Decimal, input().split()))

from types import GeneratorType

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

    return wrappedfunc

def main():

    T = iin()
    for _ in range(T):
        h, c, t = lin()
        ans = [[abs(h-t), 1]]
        md = (h+c)/2
        ans.append([abs(md-t), 2])
        if md<t:
            l, r = Decimal(1), Decimal(10**6)
            ch = 0
            while l<r:
                if ch>5:break
                x = (l+r)//2
                x1 = 2*x -1
                a1 = (x*h+(x-1)*c)/x1
                ans.append([abs(a1-t), x1])
                if a1<t:
                    r = x
                elif a1>t:
                    l = x
                else:
                    break
                if r-l<=1:
                    ch += 1
        ans.sort()
        mn =ans[0]
        # print(ans)
        print(mn[1])

# region fastio

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")

# endregion

if __name__ == "__main__":
    main()


t=int(input())
for i in range(t):
    h,c,t=map(int,input().split())
    avg=(h+c)/2
    if avg==t:
        k=2
    else:
        k=(h-avg)/(t-avg)
    print(int(k+0.5))


t=int(input())
for i in range(t):
    h,c,t=map(int,input().split())
    avg=(h+c)/2
    if avg==t:
        k=2
    else:
        k=(h-avg)/(t-avg)
    if t<avg/2:
        k=0
    if t>avg/2 and t<avg:
        k=2
    print(int(k+0.5))


from decimal import Decimal
import sys
input=sys.stdin.readline
print=sys.stdout.writelines
t=int(input())
for i in range(t):
    h,c,t=map(int,input().split())
    avg=(h+c)/2

    if  t<=avg:
        k=2
    if t>avg:
        k=int((h-avg)//(t-avg))
        if k%2==0: k+=1
        ans=k
        mn=10**7
        for j in range(-2,3,2):
            an=k+j
            if abs(Decimal(abs(an-1)*avg+h)/Decimal(abs(an))-t)<mn and an>0:
                mn=abs(Decimal(abs(an-1)*avg+h)/Decimal(abs(an))-t)
                ans=an
                #print(mn,an)
        k=int(ans)

    print(str(k))
    print('\n')


t=int(input())
for i in range(t):
    h,c,t=map(int,input().split())
    avg=(h+c)/2
    if avg==t:
        k=2
    else:
        if t!=avg:
            k=(h-avg)/(t-avg)
    if t<avg/2:
        k=0
    if t>=avg/2 and t<avg:
        k=2
    print(int(k+0.5))


t=int(input())
for i in range(t):
    h,c,t=map(int,input().split())
    avg=(h+c)/2
    if avg==t:
        k=2
    else:
        k=(h-avg)/(t-avg)
    if t<avg/2:
        k=0
    if t>=avg/2 and t<avg:
        k=2
    print(int(k+0.5))


for tt in range(int(input())):
    h, c, t = map(int, input().split())
    if t <= (h + c) // 2:
        print(2)
    else:
        num = int((t-h)/(h+c-2*t))
        num = 2*num+1
        if num % 2:
            op1 = num
            op2 = num + 2
            c1 = ((op1//2+1) * h + (op1//2) * c) / op1
            c2 = ((op2//2+1) * h + (op2//2) * c) / op2
            if abs(c1 - t) <= abs(c2 - t):
                print(op1)
            else:
                print(op2)


for tt in range(int(input())):
    h, c, t = map(int, input().split())
    if t <= (h + c) // 2:
        print(2)
    else:
        num = int((t - h) / (h + c - 2 * t))
        num = 2 * num + 1
        if num % 2:
            op1 = num
            op2 = num + 2
            c1 = abs(((op1 // 2 + 1) * h + (op1 // 2) * c) - t * op1)
            c2 = abs(((op2 // 2 + 1) * h + (op2 // 2) * c) - t * op2)
            if c1 * op2 <= c2 * op1:
                print(op1)
            else:
                print(op2)


for tt in range(int(input())):
    h, c, t = map(int, input().split())
    if t <= (h + c) // 2:
        print(2)
    else:
        num = int((t - h) / (h + c - 2 * t))
        num = 2 * num + 1
        if num % 2:
            op1 = num
            op2 = num + 2
            print(op1, op2)
            c1 = abs(((op1 // 2 + 1) * h + (op1 // 2) * c) - t * op1)
            c2 = abs(((op2 // 2 + 1) * h + (op2 // 2) * c) - t * op2)
            print(c1, c2)
            if c1 * op2 <= c2 * op1:
                print(op1)
            else:
                print(op2)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = round ( (h-t)/(2*t -h-c))
		z = x+1 +x
		print(z)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = int((t-c)/(2*t -h-c))
		tb1 = abs((2*x-1)*t- ((h+c)*x-c))*(2*x+1)
		tb2 = abs(t*(2*x+1) - ((h+c)*x+h))*(2*x-1)
		if tb2 < tb1:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10**6
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		count+=1
		if count >= 200:
			break
	print (result)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = round ( (h-t)/(2*t -h-c))
		z = x+1 +x
		print(z


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10000
	b= 0
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		b+=1
		count+=1
		if b >= 10:
			break
	print (result)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10**6
	b= 0
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		b+=1
		count+=1
		if b >= 100:
			break
	print (result)


import math
for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = math.ceil((h-t)/(2*t -h-c))
		tb1 = abs(t- ((h*x + c*(x-1))/(2*x-1)))
		tb2 = abs(t - ((h*(x+1)+c*x)/(2*x+1)))
		fr1=tb1*(2*x + 1)
		fr2 = tb2*(2*x -1)
		if fr1>fr2:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


import math
for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = math.ceil((h-t)/(2*t -h-c))
		tb1 = abs(t- ((h*x + c*(x-1))/(2*x-1)))
		print(tb1)
		tb2 = abs(t - ((h*(x+1)+c*x)/(2*x+1)))
		print (tb2)
		if tb2 <= tb1:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10**6
	b= 0
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		b+=1
		count+=1
		if b >= 20:
			break
	print (result)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = int((t-c)/(2*t -h-c))
		tb1 = abs(t- ((h+c)*x-c)/(2*x-1))
		tb2 = abs(t - ((h+c)*x+h)/(2*x+1))
		if tb2 < tb1:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


import math
from decimal import Decimal
for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = math.ceil((h-t)/(2*t -h-c))
		tb1 = Decimal(abs(t- ((h*x + c*(x-1))/(2*x-1))))
		tb2 = Decimal(abs(t - ((h*(x+1)+c*x)/(2*x+1))))
		if tb2 < tb1:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10**18
	b= 0
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		b+=1
		count+=1
		if b >= 100:
			break
	print (result)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = (h-t)/(2*t -h-c)
		if x<1:
			x = 1
		y= round (x)
		z = y+1 +y
		print(z)


for i in range(int(input())):
	h,c,t = map(int,input().split())
	go = True
	hot = True
	total = 0
	count = 1
	diff = a = 10**6
	b= 0
	while go:
		if hot:
			total += h
			hot = False
		else:
			total += c
			hot = True
		avg = total / count
		diff = (min(diff,abs(avg-t)))
		if a > diff:
			a = diff
			result = count
			b = 0
		b+=1
		count+=1
		if b >= 60:
			break
	print (result)


import math
for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = math.ceil((h-t)/(2*t -h-c))
		tb1 = abs(t- ((h*x + c*(x-1))/(2*x-1)))
		tb2 = abs(t - ((h*(x+1)+c*x)/(2*x+1)))
		if tb2 < tb1:
			z = x+1 +x
		else:
			z = x + x-1
		print(z)


import math
for i in range(int(input())):
	h,c,t = map(int,input().split())
	if h+c>= 2*t:
			print (2)
	elif h==t:
		print (1)
	else:
		x = math.ceil((h-t)/(2*t -h-c))
		tb1 = abs(t- ((h*x + c*(x-1))/(2*x-1)))
		tb2 = abs(t - ((h*(x+1)+c*x)/(2*x+1)))
		if tb2 < tb1:
			z= x+1+x
		elif tb2 == tb1:
			fr1=tb1*(2*x + 1)
			fr2 = tb2*(2*x -1)
			if fr1> fr2:
				z = x+1 +x
			else:
				z = x + x-1
		else:
			z= x+x-1
		print(z)


#include <bits/stdc++.h>
#define IOS                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);
typedef long long ll;
using namespace std;
int main(){
    IOS;
    int n;
    cin>>n;
    string s1;
    cin>>s1;
    string s2;
    cin>>s2;
    map<pair<int,int>,int>m;
    ll c=0;
    for(int i=0;i<n;i++){
        if(s2[i]=='0'){
            for(int j=0;j<n;j++){
                if(i==j)
                continue;
                if(s1[i]=='0'){
                    if(s1[j]=='1'){
                        if(m[{i,j}])
                        continue;
                        m[{i,j}]++;
                        m[{j,i}]++;
                        c++;
                    }
                }
                if(s1[i]=='1'){
                    if(s1[j]=='0'){
                        if(m[{i,j}])
                        continue;
                        m[{i,j}]++;
                        m[{j,i}]++;
                        c++;
                    }
                }
            }
        }
    }
    cout<<c<<endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
	ll x=0,y=0,z=0,r=0,n;
	string s,t;
	cin >> n;
	cin >> s >> t;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='1')
			x++;
	}
	for(ll i=0;i<n;i++)
	{
		if(t[i]=='0')
		{
			if(s[i]=='0' && x-z>0)
			{
				r+=(x-z);
				y++;
				//cout << r << " ";
			}
			else
			{
				if(n-x-y>0)
				{
					r+=(n-x-y);
					z++;
				}
				//cout << r << " ";
			}
		}
	}
	//cout << r<<x << y << z;
	cout << r ;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
	ll x=0,y=0,z=0,r=0,n;
	string s,t;
	cin >> n;
	cin >> s >> t;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='1')
			x++;
	}
	for(ll i=0;i<n;i++)
	{
		if(t[i]=='0')
		{
			if(s[i]=='0')
			{
				r+=(x-z);
				y++;
				//cout << r << " ";
			}
			else
			{
				if(n-x-y>0)
				{
					r+=(n-x-y);
					z++;
				}
				//cout << r << "a ";
			}
		}
	}
	//cout << r<<x << y << z;
	cout << r ;
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
    if((wo+wz)%2!=0 && wo!=0 && wz!=0) one--;
    if(c==0 || c2==0) cout<<0<<endl;
    else cout<<one+zero-((wo+wz)/2)<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,flag=0,flag2=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='1') flag=1;
        if(s1[i]=='0') flag2=1;
        if(s2[i]=='0') c++;
    }
    if(flag==0|| flag2==0) cout<<0<<endl;
    else cout<<c*2<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    ll n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
//    cout<<c<<" "<<c2<<endl;
    //if(wo==0 || wz==0) {wo=0;wz=0;}
    //cout<<wo<<" "<<wz<<" "<<one<<" "<<zero<<endl;
    //if((wo+wz)%2!=0 && wo!=0 && wz!=0) one--;
    if(c==0 || c2==0) cout<<0<<endl;
    else cout<<one+zero-((wo*wz))<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
    if(wo==0 || wz==0) {wo=0;wz=0;}
    //cout<<wo<<" "<<wz<<" "<<one<<" "<<zero<<endl;
    if((wo+wz)%2!=0 && wo!=0 && wz!=0) one--;
    if(c==0 || c2==0) cout<<0<<endl;
    else cout<<one+zero-((wo+wz)/2)<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
//    cout<<c<<" "<<c2<<endl;
    //if(wo==0 || wz==0) {wo=0;wz=0;}
    //cout<<wo<<" "<<wz<<" "<<one<<" "<<zero<<endl;
    //if((wo+wz)%2!=0 && wo!=0 && wz!=0) one--;
    if(c==0 || c2==0) cout<<0<<endl;
    else cout<<one+zero-((wo*wz))<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
    if(c==0 || c2==0) cout<<0<<endl;
    else cout<<one+zero-(wo+wz)+1<<endl;
    //main();
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,flag=0,flag2=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='1') {
                flag=1;
                flag2=1;
        }
        if(s2[i]=='0'  ) c++;
    }
    if(flag==0|| flag2==0) cout<<0<<endl;
    else cout<<c*2<<endl;
}


#include<bits/stdc++.h>
#define sc(a) scanf("%lld",&a)
#define pr(a) printf("%lld",a)
#define loop(i,n) loop(int i=1;i<=n;i++)
using namespace std;

typedef long long ll;

int main()
{
    int n,c=0,z=0,flag=0,flag2=0,c2=0,c3=0,one=0,zero=0,wo=0,wz=0;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        if(s1[i]=='0') c++;
        if(s1[i]=='1') c2++;
    }
    for(int i=0;i<n;i++)
    {
        if( s2[i]=='0' )
         {
             if(s1[i]=='1'){
                zero+=c;
                wo++;
             }
             else {
                one+=c2;
                wz++;
             }
         }

    }
    if((wo+wz)%2!=0) one--;
    if(c==0 || c2==0) cout<<0<<endl;

    else cout<<one+zero-((wo+wz)/2)<<endl;
    //main();
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else
			ans[3]++;
	}
	cout<<(ans[0]*(ans[1]+ans[2])+(ans[0]*a[3]))<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else if(a[i]==1&&b[i]==1)
			ans[3]++;
	}
	cout<<( ans[0]*(ans[1]+ans[2]) ) + ( ans[0]*ans[3] )<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
typedef long long ll;
ll a[maxn], b[maxn];
ll ans[10]={0};
int main()
{
	ll n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1lld",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1lld",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else if(a[i]==1&&b[i]==1)
			ans[3]++;
	}
	long long an=( ans[0]*(ans[3]+ans[2])+(ans[1]*ans[2]) );
	cout<<an<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else if(a[i]==1&&b[i]==1)
			ans[3]++;
	}
	cout<<( ans[0]*(ans[1]+ans[2])*ans[3] )<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else
			ans[3]++;
	}
	cout<<(ans[0]*(ans[1]+ans[2]+a[3])+(ans[1]*ans[2]))<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else if(a[i]==1&&b[i]==1)
			ans[3]++;
	}
	cout<<(long long)( ans[0]*(ans[3]+ans[2])+(ans[1]*ans[2]) )<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int bz[maxn];
int main()
{
	int n;
	cin>>n;
	int ans=0;
	int cnt1=0;
	int cnt2=0;
	for(int i=0;i<n;i++){
		scanf("%1d",&a[i]);
	}

	for(int i=0;i<n;i++){
		scanf("%1d",&b[i]);
	}
	for(int i=0;i<n;i++)
	{
		if(a[i]!=b[i])
			ans++;
	}
	if(ans==n)
		ans=0;
	//ans=min(cnt1,cnt2);
	ans*=2;
	cout<<ans<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int bz[maxn];
int main()
{
	int n;
	cin>>n;
	int ans=0;
	int cnt1=0;
	int cnt2=0;
	for(int i=0;i<n;i++){
		scanf("%1d",&a[i]);
		if(!a[i])
		cnt1++;
	}

	for(int i=0;i<n;i++){
		scanf("%1d",&b[i]);
		if(!b[i])
			cnt2++;
	}
	ans=min(cnt1,cnt2);
	ans*=2;
	cout<<ans<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int bz[maxn];
int main()
{
	int n;
	cin>>n;
	int ans=0;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++){
		if(a[i]==1||b[i]==1)
			bz[i]=1;
		else
			bz[i]=0;
	}
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			swap(a[i],a[j]);
			int t1=a[i]+b[i];
			int t2=a[j]+b[j];
			if(t1==2) t1=1;
			if(t2==2) t2=1;
			if(t1!=bz[i]||t2!=bz[j])
				ans++;
			swap(a[i],a[j]);
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
using namespace std;
const int maxn=1000005;
int a[maxn];
int b[maxn];
int ans[10]={0};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		scanf("%1d",&a[i]);
	for(int i=0;i<n;i++)
		scanf("%1d",&b[i]);
	for(int i=0;i<n;i++)
	{
		if(a[i]==0&&b[i]==0)
			ans[0]++;
		else if(a[i]==0&&b[i]==1)
			ans[1]++;
		else if(a[i]==1&&b[i]==0)
			ans[2]++;
		else if(a[i]==1&&b[i]==1)
			ans[3]++;
	}
	cout<<( ans[0]*(ans[3]+ans[2])+(ans[1]*ans[2]) )<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
int cnt1,cnt0,xx,yy,xy,cntyy,cntyx,cntxy;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if(a[i]=='1')
            if(b[i]=='1')
                cntyy++;
            else if(b[i]=='0')
                cntyx++;
    }
    cnt0=n-cnt1;
    for(int i=0;i<n;i++){
        if(a[i]=='0'&&b[i]=='0') xx++;
        if(a[i]=='1'&&b[i]=='1') yy++;
        if(a[i]=='0'&&b[i]=='1') xy++;
    }
    cout<<xx*cntyx+xx*yy+cntyx*xy;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
int cnt;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if((a[i]=='1'&&b[i]=='0')||(b[i]=='1'&&a[i]=='0'))
            cnt++;
    }
    cout<<cnt;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
int cnt;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if(a[i]=='1'&&b[i]=='0')
            cnt++;
        if(b[i]=='1'&&a[i]=='0')
            cnt++;
    }
    cout<<cnt;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
int cnt;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if(a[i]=='1'&&b[i]=='0')
            cnt++;
        if(b[i]=='1'&&a[i]=='0')
            cnt++;
    }
    cout<<cnt*2;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
long long cnt1,cnt0,xx,yy,xy,cntyy,cntyx,cntxy;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if(a[i]=='1')
            if(b[i]=='1')
                cntyy++;
            else if(b[i]=='0')
                cntyx++;
    }
    cnt0=n-cnt1;
    for(int i=0;i<n;i++){
        if(a[i]=='0'&&b[i]=='0') xx++;
        if(a[i]=='1'&&b[i]=='1') yy++;
        if(a[i]=='0'&&b[i]=='1') xy++;
    }
    cout<<xx*cntyx+xx*yy+cntyx*xy;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

string s,temp;
set<string> se;
int cnt;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    temp=a;
    char hold;
    s="";
    for(int i=0;i<n;i++){
        if((a[i]=='1'&&b[i]=='0')
            cnt++;
            if((b[i]=='1'&&a[i]=='0')
            cnt++;
    }
    cout<<cnt;
    return 0;
}


#include <iostream>
#include <climits>
using namespace std;
int main()
{
    int t=0,one=0,zero=0,mix=0,i,mix2=0;
	cin>>t;
	char a[t],b[t];
	cin>>a>>b;
	for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one+1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {zero=zero+1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {mix=mix+1;}
	    else
	        {mix2=mix2+1;
	        }
	}
	int sum=0;
    for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {sum=sum+zero;
		     one=one-1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {sum=sum+one+mix;
		     zero=zero-1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {  sum=sum+zero+mix2;
			   mix=mix-1;}
		else{
			sum=sum+mix;
			mix2=mix2-1;
		}
	}
	cout<<sum;
    return 0;
}


#include <iostream>
#include <climits>
using namespace std;
int main()
{
    long long int t=0,one=0,zero=0,mix=0,i,mix2=0;
	cin>>t;
	char a[t],b[t];
	cin>>a>>b;
	for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one+1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {zero=zero+1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {mix=mix+1;}
	    else
	        {mix2=mix2+1;
	        }
	}
	long long int sum=0;
    for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {sum=sum+zero;
		     one=one-1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {sum=sum+one+mix;
		     zero=zero-1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {  sum=sum+zero+mix2;
			   mix=mix-1;}
		else{
			sum=sum+mix;
			mix2=mix2-1;
		}
	}
	cout<<sum;
    return 0;
}


#include <iostream>
#include <climits>
using namespace std;
int main()
{
    long long int t=0,one=0,zero=0,mix=0,i,mix2=0;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
	cin>>t;
	char a[t],b[t];
	cin>>a>>b;
	for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one+1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {zero=zero+1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {mix=mix+1;}
	    else
	        {mix2=mix2+1;
	        }
	}
	unsigned long long int sum=0;
    for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {sum=sum+zero;
		     one=one-1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {sum=sum+one+mix;
		     zero=zero-1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {  sum=sum+zero+mix2;
			   mix=mix-1;}
		else{
			sum=sum+mix;
			mix2=mix2-1;
		}
	}
	cout<<sum;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long int t=0,one=0,zero=0,mix=0,i,mix2=0;
	cin>>t;
	char a[100000],b[100000];
	cin>>a>>b;
	//cout<<(sizeof(a)/sizeof(char));
	for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one+1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {zero=zero+1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {mix=mix+1;}
	    else
	        {mix2=mix2+1;
	        }
	}
	unsigned long long int sum=0;
    for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {sum=sum+zero;
		     one=one-1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {sum=sum+one+mix;
		     zero=zero-1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {  sum=sum+zero+mix2;
			   mix=mix-1;}
		else if(a[i]=='0'&&b[i]=='1'){
			sum=sum+mix;
			mix2=mix2-1;
		}
	}
	cout<<sum;
    return 0;
}


#include <iostream>
#include <climits>
using namespace std;
int main()
{
    int t=0,one=0,zero=0,mix=0,i,mix2=0;
	cin>>t;
	char a[t],b[t];
	cin>>a>>b;
	for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one+1;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {zero=zero+1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {mix=mix+1;}
	    else
	    {
	        mix2=mix2+1;
	    }
	}
	int sum=0;
    for(i=0;i<t;i++)
	{
		if(a[i]=='1'&&b[i]=='1')
		    {one=one-1;
		     sum=sum+zero;}
	    else if(a[i]=='0'&&b[i]=='0')
		    {sum=sum+one+mix;
		     zero=zero-1;}
		else if(a[i]=='1'&&b[i]=='0')
	        {  sum=sum+zero+mix2;
			   mix=mix-1;}
		else{
			sum=sum+mix;
			mix2=mix2-1;
		}
	}
	cout<<sum;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i;
	cin >>n;
	char a[n],b[n];
	cin >> a >> b;
	int c1=0,c2=0,c3=0,c4=0;
	for(i=0;i<n;i++){
	if(a[i]=='0' && b[i]=='1')
		c1++;
	else if(a[i]=='1' && b[i]=='1')
		c2++;
	else if( a[i] =='0' && b[i]=='0' )
		c3++;
	else
		c4++;
}
	long long int y = (long long int)c1*(long long int)c4+ (long long int)c2*(long long int)c3 + (long long int)c3*(long long int)c4;
	cout << y;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i;
	cin >>n;
	char a[2*n],b[2*n];
	cin >> a >> b;
	int c1=0,c2=0,c3=0,c4=0;
	for(i=0;i<n;i++){
	if(a[i]=='0' && b[i]=='1')
		c1++;
	else if(a[i]=='1' && b[i]=='1')
		c2++;
	else if( a[i] =='0' && b[i]=='0' )
		c3++;
	else
		c4++;
}
	long long int y = (long long int)c1*(long long int)c4+ (long long int)c2*(long long int)c3 + (long long int)c3*(long long int)c4;
	cout << y;

}


#include <bits/stdc++.h>

using namespace std;

void solve() {
    long long int s=0,mod=(1e9+7),jsum=0LL,rank=0;
    int n,owl=0,lwo=0,lwl=0,owo=0,ways=0,z=0,o=0;
    cin>>n;
    string a,b;

    cin>>a;

    cin>>b;

   for(int i=0;i<n;i++){if(a[i]=='0')z++;else o++;}
    //cout<<o<<" "<<z<<"\n";
    for(int i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0'){
            ways+=o;
            z--;
            }
            else
            {
                ways+=z;
                o--;
            }
        }

    }
    cout<<ways;
}
int main()
{
    solve();
}


#include <bits/stdc++.h>

using namespace std;

void solve() {
    long long int s=0,mod=(1e9+7),jsum=0LL,rank=0;
    int n,owl=0,lwo=0,lwl=0,owo=0,ways=0;
    cin>>n;
    string a,b;

    cin>>a;

    cin>>b;

    for(int i=0;i<n;i++)
    {
      if(b[i]=='0'){
          //cout<<"b0 ";
          if(a[i]=='0'){
          owo++;
             // cout<<"a0\n";
          }
          else if(a[i]=='1'){
              owl++;
             // cout<<"a1\n";
          }

      }

      else{if(a[i]=='0')lwo++;else lwl++;}

       // cout<<owo<<" "<<owl<<" "<<lwo<<" "<<lwl<<"\n";
    }

    for(int i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0')
            {
                ways+=(lwl+owl);
                if(owl>0)
                owl--;
                if(owo>0)owo--;
            }
            else
            {
                ways+=(lwo+owo);
                if(owl>0)
                owl--;
                if(owo>0)owo--;
            }
        }
    }
    cout<<ways;
}
int main()
{
    solve();
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    long long int t[2][2]={0};
   // string aa="0";

    for(int i=0;i<n;i++)
    {
        t[a[i]-'0'][b[i]-'0']++;
    }
    long long int ans=t[0][0]*t[1][0]+t[0][0]*t[1][1]+t[1][0]*t[0][1];

    cout<<ans;
}


#include <bits/stdc++.h>

using namespace std;

void solve() {
    long long int s=0,mod=(1e9+7),jsum=0LL,rank=0;
    int n,owl=0,lwo=0,lwl=0,owo=0,ways=0,z=0,o=0;
    cin>>n;
    string a,b;

    cin>>a;

    cin>>b;

   for(int i=0;i<n;i++){if(a[i]=='0')z++;else o++;}
    for(int i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            ways+=o;
            z--;
        }
        else
        {
            ways+=z;
            o--;
        }
    }
    cout<<ways;
}
int main()
{
    solve();
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    int t[2][2]={0};
    string aa="0";

    for(int i=0;i<n;i++)
    {
        t[a[i]-'0'][b[i]-'0']++;
    }
    long long int ans=t[0][0]*t[1][0]+t[0][0]*t[1][1]+t[1][0]*t[0][1];

    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define MOD	1000000007
#define pb	push_back
#define mp  make_pair
#define so(a)	sizeof(a)
#define ms(a,b)	memset(a,b,sizeof(a))

#define sf(c) scanf("%d",&c)
#define sfll(c) scanf("%lld",&c)
#define sfc(c) scanf("%c",&c)

#define pf(c) printf("%d\n",c)
#define pfsp(c) printf("%d ",c)
#define pfll(c) printf("%lld\n",c)
#define pfc(c) printf("%c",c)

typedef long long ll;
int flag,cnt;

// int gcd(int a,int b){
//     if(a==b)
//         return a;
//     if(a>b)
//         return gcd(a-b,b);
//     return gcd(a,b-a);
// }

// ll lcm(ll a,ll b){
//     return (a*b)/gcd(a, b);
// }

// ll power(ll a, ll b)
// {
//   ll pow = 1;
//   while ( b )
//   {
//      if ( b & 1 )
//      	pow = (pow * a)%MOD;
//      a = (a*a)%MOD;
//      b = b>>1;
//   }
//   return pow;
// }

int main()
{
	int n;
	sf(n);

	int a,b;
	int onesa=0,zeros=0,m=0,p=0;

	cin>>a>>b;

	for(int i=0;i<n;i++)
	{
		if(a%10)
			onesa++;
		else
			zeros++;

		if(b%10 && a%10)
			m++;
		else if(!(b%10) && !(a%10))
			p++;

		a/=10;
		b/=10;
	}

	cout<<(onesa*zeros)-(m*p)<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MOD	1000000007
#define pb	push_back
#define mp  make_pair
#define so(a)	sizeof(a)
#define ms(a,b)	memset(a,b,sizeof(a))

#define sf(c) scanf("%d",&c)
#define sfll(c) scanf("%lld",&c)
#define sfc(c) scanf("%c",&c)

#define pf(c) printf("%d\n",c)
#define pfsp(c) printf("%d ",c)
#define pfll(c) printf("%lld\n",c)
#define pfc(c) printf("%c",c)

typedef long long ll;
int flag,cnt;

// int gcd(int a,int b){
//     if(a==b)
//         return a;
//     if(a>b)
//         return gcd(a-b,b);
//     return gcd(a,b-a);
// }

// ll lcm(ll a,ll b){
//     return (a*b)/gcd(a, b);
// }

// ll power(ll a, ll b)
// {
//   ll pow = 1;
//   while ( b )
//   {
//      if ( b & 1 )
//      	pow = (pow * a)%MOD;
//      a = (a*a)%MOD;
//      b = b>>1;
//   }
//   return pow;
// }

int main()
{
	int n;
	sf(n);

	string a,b;
	long long onesa=0,zeros=0,m=0,p=0;

	cin>>a>>b;

	for(int i=0;i<n;i++)
	{
		if(a[i]=='1')
			onesa++;
		else
			zeros++;

		if(b[i]=='1' && a[i]=='1')
			m++;
		else if(b[i]=='1' && a[i]=='0')
			p++;
	}

	cout<<(onesa*zeros)-(m*p)<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MOD	1000000007
#define pb	push_back
#define mp  make_pair
#define so(a)	sizeof(a)
#define ms(a,b)	memset(a,b,sizeof(a))

#define sf(c) scanf("%d",&c)
#define sfll(c) scanf("%lld",&c)
#define sfc(c) scanf("%c",&c)

#define pf(c) printf("%d\n",c)
#define pfsp(c) printf("%d ",c)
#define pfll(c) printf("%lld\n",c)
#define pfc(c) printf("%c",c)

typedef long long ll;
int flag,cnt;

// int gcd(int a,int b){
//     if(a==b)
//         return a;
//     if(a>b)
//         return gcd(a-b,b);
//     return gcd(a,b-a);
// }

// ll lcm(ll a,ll b){
//     return (a*b)/gcd(a, b);
// }

// ll power(ll a, ll b)
// {
//   ll pow = 1;
//   while ( b )
//   {
//      if ( b & 1 )
//      	pow = (pow * a)%MOD;
//      a = (a*a)%MOD;
//      b = b>>1;
//   }
//   return pow;
// }

int main()
{
	int n;
	sf(n);

	string a,b;
	int onesa=0,zeros=0,m=0,p=0;

	cin>>a>>b;

	for(int i=0;i<n;i++)
	{
		if(a[i])
			onesa++;
		else
			zeros++;

		if(b[i] && a[i])
			m++;
		else if(b[i] && !(a[i]))
			p++;
	}

	cout<<(onesa*zeros)-(m*p)<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MOD	1000000007
#define pb	push_back
#define mp  make_pair
#define so(a)	sizeof(a)
#define ms(a,b)	memset(a,b,sizeof(a))

#define sf(c) scanf("%d",&c)
#define sfll(c) scanf("%lld",&c)
#define sfc(c) scanf("%c",&c)

#define pf(c) printf("%d\n",c)
#define pfsp(c) printf("%d ",c)
#define pfll(c) printf("%lld\n",c)
#define pfc(c) printf("%c",c)

typedef long long ll;
int flag,cnt;

// int gcd(int a,int b){
//     if(a==b)
//         return a;
//     if(a>b)
//         return gcd(a-b,b);
//     return gcd(a,b-a);
// }

// ll lcm(ll a,ll b){
//     return (a*b)/gcd(a, b);
// }

// ll power(ll a, ll b)
// {
//   ll pow = 1;
//   while ( b )
//   {
//      if ( b & 1 )
//      	pow = (pow * a)%MOD;
//      a = (a*a)%MOD;
//      b = b>>1;
//   }
//   return pow;
// }

int main()
{
	int n;
	sf(n);

	string a,b;
	int onesa=0,zeros=0,m=0,p=0;

	cin>>a>>b;

	for(int i=0;i<n;i++)
	{
		if(a[i]=='1')
			onesa++;
		else
			zeros++;

		if(b[i]=='1' && a[i]=='1')
			m++;
		else if(b[i]=='1' && a[i]=='0')
			p++;
	}

	cout<<(onesa*zeros)-(m*p)<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MOD	1000000007
#define pb	push_back
#define mp  make_pair
#define so(a)	sizeof(a)
#define ms(a,b)	memset(a,b,sizeof(a))

#define sf(c) scanf("%d",&c)
#define sfll(c) scanf("%lld",&c)
#define sfc(c) scanf("%c",&c)

#define pf(c) printf("%d\n",c)
#define pfsp(c) printf("%d ",c)
#define pfll(c) printf("%lld\n",c)
#define pfc(c) printf("%c",c)

typedef long long ll;
int flag,cnt;

// int gcd(int a,int b){
//     if(a==b)
//         return a;
//     if(a>b)
//         return gcd(a-b,b);
//     return gcd(a,b-a);
// }

// ll lcm(ll a,ll b){
//     return (a*b)/gcd(a, b);
// }

// ll power(ll a, ll b)
// {
//   ll pow = 1;
//   while ( b )
//   {
//      if ( b & 1 )
//      	pow = (pow * a)%MOD;
//      a = (a*a)%MOD;
//      b = b>>1;
//   }
//   return pow;
// }

int main()
{
	int n;
	sf(n);

	int a,b;
	int onesa=0,zeros=0,m=0,p=0;

	cin>>a>>b;

	for(int i=0;i<n;i++)
	{
		if(a%10)
			onesa++;
		else
			zeros++;

		if(b%10 && a%10)
			m++;
		else if(b%10 && !(a%10))
			p++;

		a/=10;
		b/=10;
	}

	cout<<(onesa*zeros)-(m*p)<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
    int s11=0;
    int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    long long int x=0;
    long long int y=0;
    for(i=n;i>=0;i--)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else if(a[i]=='1') y++;
        }
    }
    long long int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
     int s11=0;
     int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    long long int x=0;
    long long int y=0;
    for(i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else if(a[i]=='1') y++;
        }
    }
    long long int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
    int s11=0;
    int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    int x=0;
    int y=0;
    for(i=n-1;i>=0;i--)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else if(a[i]=='1') y++;
        }
    }
    long long int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
     int s11=0;
     int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    int x=0;
     int y=0;
    for(i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else if(a[i]=='1') y++;
        }
    }
    long long int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
    int s11=0;
    int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    int x=0;
    int y=0;
    for(i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else y++;
        }
    }
    int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a;
    cin >> b;
    int s10=0;
    int s11=0;
    int i,j;
    for(i=0;i<n;i++)
    {
        if(a[i]=='1') s11++;
        else s10++;
    }
    int x=0;
    int y=0;
    for(i=0;i<n;i++)
    {
        if(b[i]=='0')
        {
            if(a[i]=='0') x++;
            else if(a[i]=='1') y++;
        }
    }
    long long int ans;
    ans=s11*x;
    ans+=(s10-x)*y;
    cout << ans << '\n';

}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,ans,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    cout<<zz*(o+oo)+z*o+o*(z+zz)+oo*zz/2;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,k,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    cout<<max(o,zz)+max(z,oo)+max(o,z);
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,ans,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    cout<<(zz*(o+oo)+z*o+o*(z+zz)+oo*zz)/2;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
long long n,ans,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    cout<<(zz*(o+oo)+z*o+o*(z+zz)+oo*zz)/2;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,k;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
       if((a[i]!=a[j]) && a[i]+b[j]!=b[i]+a[j]) k++;
 cout<<k/2;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,k,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    cout<<o*zz+z*oo+o*z;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mi 1e18

using namespace std;
string a,b;
int n,ans,z,o,zz,oo;
int main()
{_
 cin>>n;
 cin>>a>>b;
   for(int i=0;i<n;i++)
   {
     if(a[i]=='0' && b[i]=='1') z++;
     if(a[i]=='1' && b[i]=='0') o++;
     if(a[i]==b[i] && a[i]=='1') oo++;
     if(a[i]==b[i] && a[i]=='0') zz++;
   }
    if(o*zz!=0) ans+=o*zz; else ans+=o+zz;
    if(oo*z!=0) ans+=oo*z; else ans+=oo+z;
    if(o*z!=0) ans+=o*z; else ans+=o+z;
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int one,zero,n;
    long long res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero==0)break;
        if(one==0)break;

        if(st2[i] == '0'){
            if(st1[i]=='0' && one){

               res += one;
               zero--;

            }if(st1[i]=='1' && zero){
              res += zero;
              one--;

            }
        }
    }

    printf("%d\n",res);

  return 0;

}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int one,zero,n;
    long long res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero<0)zero= 0;
        if(one<0)one= 0;

        if(st2[i] == '0'){
            if(st1[i]=='0'){

               res += one;
               zero--;

            }else{
              res += zero;
              one--;

            }
        }
    }

    printf("%d\n",res);

  return 0;

}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int one,zero,n;
    long long res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero==0)zero=0;
        if(one==0)one=0;

        if(st2[i] == '0'){
            if(st1[i]=='0' && zero){

               res += one;
               zero--;

            }if(st1[i]=='1' && one){
              res += zero;
              one--;

            }
        }
    }

    printf("%d\n",res);

  return 0;

}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int one,zero,n;
    long long res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero<0)zero= 0;
        if(one<0)one= 0;

        if(st2[i] == '0'){
            if(st1[i]=='0' && one){

               res += one;
               zero--;

            }if(st1[i]=='1' && zero){
              res += zero;
              one--;

            }
        }
    }

    printf("%d\n",res);

  return 0;

}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int n;
    long long  one,zero;
    long long res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero==0 || one ==0)break;
        if(st2[i] == '0'){
            if(st1[i]=='0'){

               res += one;
               zero--;

            }else if(st1[i]=='1'){
              res += zero;
              one--;

            }
        }
    }

    printf("%lld\n",res);

  return 0;

}


#include<bits/stdc++.h>
using namespace std;

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

const int mx = 1234567;
int ar[mx],x[mx],y[mx];

int main(){

    // freopen("in.txt","r", stdin);
    // freopen("out.txt","w", stdout);

    string st1,st2;
    int one,zero,n;
    int res = 0;
    res = one = zero = 0;
    cin>>n;
    cin>>st1;
    cin>>st2;
    for(int i = 0; i < n; i++){
        if(st1[i] == '0')zero++;
        else one++;
       x[i] = zero;
       y[i] = one;
    }

    //cout<<one<<" "<<zero<<endl;

    for(int i = 0; i < n; i++){
        if(zero==0 || one ==0)break;
        if(st2[i] == '0'){
            if(st1[i]=='0'){

               res += one;
               zero--;

            }else if(st1[i]=='1'){
              res += zero;
              one--;

            }
        }
    }

    printf("%d\n",res);

  return 0;

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int arr[4]={0,0,0,0};
    char c1[4]={'0','0','1','1'};
    char c2[4]={'0','1','0','1'};
    long long answer;
    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    for(int i=0;i<n;++i){
        for(int j=0;j<4;++j){
            if(a[i]==c1[j] && b[i]==c2[j]){
                ++arr[j];
            }
        }
    }
    answer=arr[0]*arr[2]+arr[0]*arr[3]+arr[1]*arr[2];
    cout<<answer;
    return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int arr[4]={0,0,0,0};
    char c1[4]={'0','0','1','1'};
    char c2[4]={'0','1','0','1'};
    ll n,ans;
    cin>>n;
    string a,b;
    cin>>a>>b;
    for(long long i=0;i<n;++i){
        for(int j=0;j<4;++j){
            if(a[i]==c1[j] && b[i]==c2[j]){
                ++arr[j];
            }
        }
    }
    ans=(ll)arr[0]*(ll)arr[2]+(ll)arr[0]*(ll)arr[3]+(ll)arr[1]*(ll)arr[2];
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int arr[4]={0,0,0,0};
    char c1[4]={'0','0','1','1'};
    char c2[4]={'0','1','0','1'};
    long long n,ans;
    cin>>n;
    string a,b;
    cin>>a>>b;
    for(long long i=0;i<n;++i){
        for(int j=0;j<4;++j){
            if(a[i]==c1[j] && b[i]==c2[j]){
                ++arr[j];
            }
        }
    }
    ans=arr[0]*arr[2]+arr[0]*arr[3]+arr[1]*arr[2];
    cout<<ans;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	char a[n],b[n];
	cin>>a>>b;
	int zero=0,ans=0,one=0;
	for(i=0;i<n;i++)
	{
		if(a[i]=='0')
			zero++;
		else
			one++;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]=='0'&&b[i]=='0')
		{
			ans+=one;
			zero--;
		}
		else if(a[i]=='1'&&b[i]=='0')
		{
			ans+=zero;
			one--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	long long int n,i,j;
	cin>>n;
	string a,b;
	cin>>a>>b;
	long long int zero=0,one=0;
	long long int ans=0;
	for(i=0;i<n;i++)
	{
		if(a[i]=='0')
			zero++;
		else
			one++;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]=='0'&&b[i]=='0'&& zero>0)
		{
			ans+=one;
			zero--;
		}
		else if(a[i]=='1'&&b[i]=='0'&& one>0)
		{
			ans+=zero;
			one--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	char a[n],b[n];
	cin>>a>>b;
	int zero=0,one=0;
	long long int ans=0;
	for(i=0;i<n;i++)
	{
		if(a[i]=='0')
			zero++;
		else
			one++;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]=='0'&&b[i]=='0'&& zero>0)
		{
			ans+=one;
			zero--;
		}
		else if(a[i]=='1'&&b[i]=='0'&& one>0)
		{
			ans+=zero;
			one--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	char a[n],b[n];
	cin>>a>>b;
	int zero=0,one=0;
	long int ans=0;
	for(i=0;i<n;i++)
	{
		if(a[i]=='0')
			zero++;
		else
			one++;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]=='0'&&b[i]=='0')
		{
			ans+=one;
			zero--;
		}
		else if(a[i]=='1'&&b[i]=='0')
		{
			ans+=zero;
			one--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	char a[n],b[n];
	cin>>a>>b;
	int zero=0,one=0;
	long long int ans=0;
	for(i=0;i<n;i++)
	{
		if(a[i]=='0')
			zero++;
		else
			one++;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]=='0'&&b[i]=='0')
		{
			ans+=one;
			zero--;
		}
		else if(a[i]=='1'&&b[i]=='0')
		{
			ans+=zero;
			one--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


///////////////////// author : TrEbLeCleF /////////////////////
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define deb(x) cerr <<#x<<" = "<<x<<"\n"
#define print(v,s,e) for(int i = s; i < e; i++)cout << v[i]<<" ";cout<<"\n";
#define INF 1e17
#define PI 3.14159265358979323846
int del_x[4] = {-1, 1, 0, 0};
int del_y[4] = {0, 0, 1, -1};
int XX[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int YY[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
/////////////////////////// GLOBAL ///////////////////////////

/////////////////////////// GLOBAL ///////////////////////////
void solve(){
	int n;cin >> n;
	int a[n];
	int S = 0, X = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		S+=a[i];
		X^=a[i];
	}
	if(S==2*X){
		cout << 0 <<"\n";
		cout <<"\n";
	}
	else{
		if(S==X && S/2!=0){
			cout << 2 <<"\n";
			cout << S/2 <<" "<<S/2 <<"\n";
		}
		else{
			ll low = 1, high = 1e18;
			ll ans;
			while(low<=high){
				ll mid = low+(high-low)/2;
				if((mid%2==0 && S%2!=0) || (mid%2!=0&&S%2==0)){
					mid++;
				}
				if(2*(X^mid)-mid-S > 0){
					ans = mid;
					break;
				}
				else{
					low = mid+1;
				}

			}
			cout << 3 <<"\n";
			ll other = (2*(X^ans)-ans-S)/2;
			cout << ans <<" "<<other <<" "<<other<<"\n";
			//cout << "sum = "<<S+2*other+ans<<"\n";
			//cout <<"xor - "<<(ans^X) <<"\n";
		}
	}

}

int main(){
	#ifndef ONLINE_JUDGE
	clock_t tStart = clock();
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
    ios_base:: sync_with_stdio(false);
   	cin.tie(0);
	int t=1;
	cin >> t;
	while(t--){
		solve();
	}
	/* #ifndef ONLINE_JUDGE
    printf("\nRun Time -> %.10fs\n", (double)(clock()-tStart) / CLOCKS_PER_SEC);
    #endif  */
}


///////////////////// author : TrEbLeCleF /////////////////////
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define deb(x) cerr <<#x<<" = "<<x<<"\n"
#define print(v,s,e) for(int i = s; i < e; i++)cout << v[i]<<" ";cout<<"\n";
#define INF 1e17
#define PI 3.14159265358979323846
int del_x[4] = {-1, 1, 0, 0};
int del_y[4] = {0, 0, 1, -1};
int XX[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int YY[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
/////////////////////////// GLOBAL ///////////////////////////

/////////////////////////// GLOBAL ///////////////////////////
void solve(){
	int n;cin >> n;
	int a[n];
	int S = 0, X = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		S+=a[i];
		X^=a[i];
	}
	if(S==2*X){
		cout << 0 <<"\n";
		cout <<"\n";
	}
	else{
		if(S==X){
			cout << 2 <<"\n";
			cout << S/2 <<" "<<S/2 <<"\n";
		}
		else{
			ll low = 1, high = 1e18;
			ll ans;
			while(low<=high){
				ll mid = low+(high-low)/2;
				if((mid%2==0 && S%2!=0) || (mid%2!=0&&S%2==0)){
					mid++;
				}
				if(2*(X^mid)-mid-S > 0){
					ans = mid;
					break;
				}
				else{
					low = mid+1;
				}

			}
			cout << 3 <<"\n";
			ll other = (2*(X^ans)-ans-S)/2;
			cout << ans <<" "<<other <<" "<<other<<"\n";
			//cout << "sum = "<<S+2*other+ans<<"\n";
			//cout <<"xor - "<<ans <<"\n";
		}
	}

}

int main(){
	#ifndef ONLINE_JUDGE
	clock_t tStart = clock();
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
    ios_base:: sync_with_stdio(false);
   	cin.tie(0);
	int t=1;
	cin >> t;
	while(t--){
		solve();
	}
	/* #ifndef ONLINE_JUDGE
    printf("\nRun Time -> %.10fs\n", (double)(clock()-tStart) / CLOCKS_PER_SEC);
    #endif  */
}


///////////////////// author : TrEbLeCleF /////////////////////
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define deb(x) cerr <<#x<<" = "<<x<<"\n"
#define print(v,s,e) for(int i = s; i < e; i++)cout << v[i]<<" ";cout<<"\n";
#define INF 1e17
#define PI 3.14159265358979323846
int del_x[4] = {-1, 1, 0, 0};
int del_y[4] = {0, 0, 1, -1};
int XX[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int YY[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
/////////////////////////// GLOBAL ///////////////////////////

/////////////////////////// GLOBAL ///////////////////////////
void solve(){
	int n;cin >> n;
	int a[n];
	int S = 0, X = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		S+=a[i];
		X^=a[i];
	}
	if(S==2*X){
		cout << 0 <<"\n";
		cout <<"\n";
	}
	else{
		if(S==X){
			cout << 2 <<"\n";
			cout << S/2 <<" "<<S/2 <<"\n";
		}
		else{
			ll low = 1, high = 100;
			ll ans;
			while(low<=high){
				ll mid = low+(high-low)/2;
				if(2*(X^mid)-mid-S > 0){
					ans = mid;
					break;
				}
				else{
					high = mid-1;
				}
			}
			cout << 3 <<"\n";
			int other = (2*(X^ans)-ans-S)/2;
			cout << ans <<" "<<other <<" "<<other<<"\n";
		}
	}

}

int main(){
	#ifndef ONLINE_JUDGE
	clock_t tStart = clock();
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
    ios_base:: sync_with_stdio(false);
   	cin.tie(0);
	int t=1;
	cin >> t;
	while(t--){
		solve();
	}
	/* #ifndef ONLINE_JUDGE
    printf("\nRun Time -> %.10fs\n", (double)(clock()-tStart) / CLOCKS_PER_SEC);
    #endif  */
}


///////////////////// author : TrEbLeCleF /////////////////////
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define deb(x) cerr <<#x<<" = "<<x<<"\n"
#define print(v,s,e) for(int i = s; i < e; i++)cout << v[i]<<" ";cout<<"\n";
#define INF 1e17
#define PI 3.14159265358979323846
int del_x[4] = {-1, 1, 0, 0};
int del_y[4] = {0, 0, 1, -1};
int XX[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int YY[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
/////////////////////////// GLOBAL ///////////////////////////

/////////////////////////// GLOBAL ///////////////////////////
void solve(){
	int n;cin >> n;
	int a[n];
	int S = 0, X = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		S+=a[i];
		X^=a[i];
	}
	if(S==2*X){
		cout << 0 <<"\n";
		cout <<"\n";
	}
	else{
		if(S==X){
			cout << 2 <<"\n";
			cout << S/2 <<" "<<S/2 <<"\n";
		}
		else{
			ll low = 1, high = 1e18;
			ll ans;
			while(low<=high){
				ll mid = low+(high-low)/2;
				if((mid&1)^(S^1)){
					mid--;
				}
				if(2*(X^mid)-mid-S > 0){
					ans = mid;
					break;
				}
				else{
					high = mid-1;
				}

			}
			cout << 3 <<"\n";
			ll other = (2*(X^ans)-ans-S)/2;
			cout << ans <<" "<<other <<" "<<other<<"\n";
		}
	}

}

int main(){
	#ifndef ONLINE_JUDGE
	clock_t tStart = clock();
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
    ios_base:: sync_with_stdio(false);
   	cin.tie(0);
	int t=1;
	cin >> t;
	while(t--){
		solve();
	}
	/* #ifndef ONLINE_JUDGE
    printf("\nRun Time -> %.10fs\n", (double)(clock()-tStart) / CLOCKS_PER_SEC);
    #endif  */
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            if(sum%2==1){
                ++k;
                ans.pb(1);
                sum++;xr^=1;
            }
            k+=2;
            ans.pb(xr-sum/2);ans.pb(xr-sum/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            ll m,l=0,u=1e18;int f=0;
            while(l<=u){
                m=(l+u)/2;f++;
                if((sum+m)>=(2*(xr^m))){
                    ++k;
                    if(m%2==sum%2) {
                        ans.pb(m);
                        sum += m;
                        xr ^= m;
                    }
                    else{
                        if(m<1e18)++m;
                        else --m;
                        ans.pb(m);
                        sum += m;
                        xr ^= m;
                    }
                    break;
                }
                else if((sum+m)<(2*(xr^m))){
                    u=m-1;
                }
            }
            k+=2;
            ans.pb(xr-sum/2);ans.pb(xr-sum/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum%2==1){
            ++k;
            ans.pb(1);
            sum++;xr^=1;
        }
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            k+=2;
            ans.pb(xr-sum/2);ans.pb(xr-sum/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            ll m,l=0,u=1e18;k++;
            while(l<=u){
                m=(l+u)/2;
                if((sum+m)>(2*(xr^m))){
                    l=m+1;
                }
                else if((sum+m)<(2*(xr^m))){
                    u=m-1;
                }
                else{
                    ans.pb(m);
                    break;
                }
            }
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum%2==1){
            ++k;
            ans.pb(1);
            sum++;xr^=1;
        }
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            k+=2;
            ans.pb(xr/2);ans.pb(xr/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            k++;
            ans.pb(sum);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum%2==1){
            ++k;
            ans.pb(1);
            sum++;xr^=1;
        }
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            k+=2;
            ans.pb(xr-sum/2);ans.pb(xr-sum/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            k++;
            ans.pb(sum);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        if(sum%2==0) {
            ans.pb(ll(1e18));
            sum += ll(1e18);
            xr ^= ll(1e18);
        }
        else{
            ans.pb(ll(1e18)-1);
            sum += ll(1e18-1);
            xr ^= ll(1e18-1);
        }
        k+=3;
        ans.pb(xr-sum/2);ans.pb(xr-sum/2);
        cout<<k<<endl;
        fr(i,ans)cout<<i<<" ";
        cout<<endl;
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum%2==1){
            ++k;
            ans.pb(1);
            sum++;xr^=1;
        }
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            ll y=sum&(-sum);
            y>>=(1ll);
            k+=2;
            ans.pb(y);ans.pb(y);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            k++;
            ll y=(1ll<<(ll(log2(sum))));
            ans.pb(y);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else {
            if (sum % 2 == 0) {
                ans.pb(ll(1e18));
                sum += ll(1e18);
                xr ^= ll(1e18);
            } else {
                ans.pb(ll(1e18) - 1);
                sum += ll(1e18 - 1);
                xr ^= ll(1e18 - 1);
            }
            k += 3;
            ans.pb(xr - sum / 2);
            ans.pb(xr - sum / 2);
            cout << k << endl;
            fr(i, ans)cout << i << " ";
            cout << endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum%2==1){
            ++k;
            ans.pb(1);
            sum++;xr^=1;
        }
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else if(sum<2*xr){
            k+=2;
            ans.pb(xr/2);ans.pb(xr/2);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else{
            k++;
            ll y=(1ll<<(ll(log2(sum))));
            ans.pb(y);
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}
int main(){
    //clock_t tm = clock();
    fastio;
    ll t,n;
    cin>>t;
    while(t--){
        cin>>n;
        vl a(n);
        ll sum=0,xr=0;
        f(i,0,n){
            cin>>a[i];
            sum+=a[i];
            xr^=a[i];
        }
        int k=0;vl ans;
        if(sum==2*xr){
            cout<<k<<endl;
            fr(i,ans)cout<<i<<" ";
            cout<<endl;
        }
        else {
            if (sum % 2 == 0) {
                ans.pb(ll(1e15));
                sum += ll(1e15);
                xr ^= ll(1e15);
            }
            else {
                ans.pb(ll(1e15+1));
                sum += ll(1e15+1);
                xr ^= ll(1e15+1);
            }
            k += 3;
            ans.pb(xr - sum / 2);
            ans.pb(xr - sum / 2);
            cout << k << endl;
            fr(i, ans)cout << i << " ";
            cout << endl;
        }
    }
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        if((2*xorr)==sum) {
            cout<<0<<endl; cout<<endl; continue;
        }
        if(xorr==0) {
            cout<<1<<endl;
            cout<<sum<<endl;
            continue;
        }
        if(sum%2==0) {
            ll k=(2*xorr-sum)/2;
            k=abs(k);
            cout<<2<<endl;
            cout<<k<<" "<<k<<endl;
        }
        else {
            for(i=1;i<=1000000000;i++) {
                if(2*(xorr^i)==(sum+i)) {
                    cout<<1<<endl;
                    cout<<i<<endl;
                    break;
                }
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        if((2*xorr)==sum) {
            cout<<0<<endl; cout<<endl; continue;
        }
        if(xorr==0) {
            cout<<1<<endl;
            cout<<sum<<endl;
            continue;
        }
        if(sum%2==0) {
            ll k=(2*xorr-sum)/2;
            k=abs(k);
            cout<<2<<endl;
            cout<<k<<" "<<k<<endl;
        }
        else {
            xorr^=1;
            ++sum;
            ll k=(2*xorr-sum)/2;
            k=abs(k);
            cout<<3<<endl;
            cout<<1<<" "<<k<<" "<<k<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        if((2*xorr)==sum) {
            cout<<0<<endl; cout<<endl; continue;
        }
        for(i=1;i<=1000000000;i++) {
                if((2*(xorr^i))==(sum+i)) {
                    cout<<1<<endl;// cout<<(xorr^i)<<" "<<sum+i<<" ";
                    cout<<i<<endl;
                    break;
                }
            }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        for(i=1;i<=1000000000;i++) {
                if((2*(xorr^i))==(sum+i)) {
                    cout<<1<<endl;// cout<<(xorr^i)<<" "<<sum+i<<" ";
                    cout<<i<<endl;
                    break;
                }
            }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        if((2*xorr)==sum) {
            cout<<0<<endl; cout<<endl; continue;
        }
        cout<<2<<endl<<xorr<<" "<<sum+xorr<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int  main() {
    ll t; cin>>t;
    while(t--) {
        ll n; cin>>n;
        ll i; ll a[n]; ll sum=0; ll xorr=0;
        for(i=0;i<n;i++) {
            cin>>a[i]; sum+=a[i]; xorr^=a[i];
        }
        if((2*xorr)==sum) {
            cout<<0<<endl; cout<<endl; continue;
        }
        if(xorr==0) {
            cout<<1<<endl;
            cout<<sum<<endl;
            continue;
        }
        //cout<<xorr<<" "<<sum<<endl;
        for(i=1;i<=1000000000;i++) {
                if((2*(xorr^i))==(sum+i)) {
                    cout<<1<<endl;// cout<<(xorr^i)<<" "<<sum+i<<" ";
                    cout<<i<<endl;
                    break;
                }
            }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vii = vector<ii>;
const ll MOD = 998244353;
const int INF = 1e9+9;
const int MAXN = 1000006;

ll t, n, m, k, arr[MAXN];

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    ll s = 0, x = 0;
    cin >> n;
    for (ll i = 0, j; i < n; i++) {
      cin >> j;
      s+=j;
      x^=j;
    }

    ll ans1=0, ans2=0, ans3=0;
    ll d = s-2*x;
    if (d < 0) {
      if ((-d)&1) {
        ans3 = 1;
        s+=1;
        x^=1;
        d = s-2*x;
      }
    }

    if (d>0) {
      for (ll i = 0; i < 62; i++) {
        if (d&(1<<i)) {
          if (x&(1<<i)) {
            ans1 |= (1<<i);
            d+=(1<<i)+(1<<(i+1));
          } else {
            ans1 |= (1<<i);
            d-=(1<<i);
          }
        }
      }
      assert(d==0);
    } else if (d < 0) {
      //assert(((-d)%2)==0);
      ans1 = -d/2;
      ans2 = -d/2;
    }

    cout << "3\n" << ans1 << ' ' << ans2 << ' ' << ans3 << '\n';
  }

}