# Google Code Jam 2023 Farewell Round B - Collecting Pancakes t = int(input()) for case in range(1, t + 1): n = int(input()) a = list(map(int, input().split())) la, ra, lb, rb = map(int, input().split()) la -= 1 ra -= 1 lb -= 1 rb -= 1 total = sum(a) lsum = [0]*(n+1) for i in range(n): lsum[i+1] = lsum[i] + a[i] ans = 0 for i in range(la, ra+1): if rb < i: index = rb + (i-rb-1)//2 + 1 ans = max(ans, total - lsum[index]) elif i < lb: index = i + (lb-i)//2 + 1 ans = max(ans, lsum[index]) else: bob = 0 if lb < i: bob = max(bob, lsum[i]) if i < rb: bob = max(bob, total - lsum[i+1]) ans = max(ans, total-bob) print("Case #{}: {}".format(case, ans))