t = int(raw_input())
sm = 0
for testcase in xrange(t):
    n = int(raw_input())
    assert(n >= 1 and n <= 2*10**4)
    sm += n
    xenny = map(int, raw_input().split())
    yana = map(int, raw_input().split())
    # print xenny
    # print yana
    t1, t2 = 0, 0
    p1, p2 = 0, 0
    for i in xrange(n):
        assert(xenny[i] >= 1 and xenny[i] <= 10**5)
        assert(yana[i] >= 1 and yana[i] <= 10**5)
        t1 += (xenny[i] if p1 == 0 else yana[i])
        t2 += (yana[i] if p2 == 0 else xenny[i])
        p1 ^= 1
        p2 ^= 1
    print min(t1, t2)
assert(sm <= 2*10**5)