<reponame>brunodccarvalho/competitive
from decimal import *
getcontext().prec = 30

for tc in range(int(input())):
    [N, R, G] = map(int, input().split())
    win = map(Decimal, input().split())
    win = sorted(win, reverse=True)
    zero = Decimal(0)

    first = [zero]
    for topK in range(1, N + 1):
        first.append(sum(win[0:topK]))

    M = R * G
    a = [zero] * (M + 1)
    count = [zero] * (M + 1)
    Ewin = sum(win) / N

    for g in range(0, G):
        a[g] = Decimal(Ewin)
        count[g] = Decimal(1)

    for g in range(G, M + 1):
        X, C = 0, 0
        for i in range(g - G, g):
            X += count[i] * a[i]
            C += count[i]
        for K in range(1, N):
            Y = first[K] / K
            r = Decimal(1.0 * N / K - 1)
            T = r * C + 1
            gain = (Y + r * X) / T
            if a[g] < gain:
                a[g] = gain
                count[g] = T

    print("Case #%d: %.15f" % (tc + 1, a[M]))

from decimal import *
getcontext().prec = 30

for tc in range(int(input())):
    [N, R, G] = map(int, input().split())
    win = map(Decimal, input().split())
    win = sorted(win, reverse=True)
    zero = Decimal(0)

    first = [zero]
    for topK in range(1, N + 1):
        first.append(sum(win[0:topK]))

    M = R * G
    a = [zero] * (M + 1)
    count = [zero] * (M + 1)
    Ewin = sum(win) / N

    for g in range(0, G):
        a[g] = Decimal(Ewin)
        count[g] = Decimal(1)

    for g in range(G, M + 1):
        X, C = 0, 0
        for i in range(g - G, g):
            X += count[i] * a[i]
            C += count[i]
        for K in range(1, N):
            Y = first[K] / K
            r = Decimal(1.0 * N / K - 1)
            T = r * C + 1
            gain = (Y + r * X) / T
            if a[g] < gain:
                a[g] = gain
                count[g] = T

    print("Case #%d: %.15f" % (tc + 1, a[M]))
#%d: %.15f" % (tc + 1, a[M]))