Help me in solving AO17 problem

My issue

please explain it

My code

# Update the code below to solve this problem

t = int(input())
for i in range(t):
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

Learning course: Solve Programming problems using Python
Problem Link: CodeChef: Practical coding for everyone

The logic is sum up the values of A and B and subtract the max value of A and max value of B from their sum and then compare them.