Buggy python submission (verdict: Runtime Error):
memo = [[0] * 60 for i in range(60)]

def comb(n,k):
    if memo[n][k] > 0:
        return memo[n][k]
    elif k == 0 or k == n:
        memo[n][k] = 1
        return memo[n][k]
    else:
        memo[n][k] = comb(n-1,k) + comb(n-1,k-1)
        return memo[n][k]

n,a,b = map(int,input().split(' '))
v = list(map(int,input().split(' ')))

v.sort()
v.reverse()
if len(set(v)) == 1:
    print(v[0])
    ans = 0
    for i in range(a,b+1):
        ans += comb(n,i) 
    print(ans)
else:
    total = 0
    for i in range(a):
        total += v[i]
    print("%.10f" % total/a)
    if a < n and v[a] == v[a-1]:
        l = r = 0
        for i in range(n):
            if v[i] == v[a]:
                if i < a:
                    l += 1
                else:
                    r += 1
        print(comb(l+r,l))
    else:
        print(1)

Fixed submission:
memo = [[0] * 60 for i in range(60)]

def comb(n,k):
    if memo[n][k] > 0:
        return memo[n][k]
    elif k == 0 or k == n:
        memo[n][k] = 1
        return memo[n][k]
    else:
        memo[n][k] = comb(n-1,k) + comb(n-1,k-1)
        return memo[n][k]

n,a,b = map(int,input().split(' '))
v = list(map(int,input().split(' ')))

v.sort()
v.reverse()
if len(set(v[:a])) == 1:
    print(v[0])
    cnt = 0
    for i in range(n):
        if v[i] == v[0]:
            cnt += 1
    ans = 0
    for i in range(a,min(b,cnt)+1):
        ans += comb(cnt,i) 
    print(ans)
else:
    total = 0
    for i in range(a):
        total += v[i]
    print("%.10f" % (total/a))
    if a < n and v[a] == v[a-1]:
        l = r = 0
        for i in range(n):
            if v[i] == v[a]:
                if i < a:
                    l += 1
                else:
                    r += 1
        print(comb(l+r,l))
    else:
        print(1)

Buggy python submission (verdict: Runtime Error):
memo = [[0] * 60 for i in range(60)]

def comb(n,k):
    if memo[n][k] > 0:
        return memo[n][k]
    elif k == 0 or k == n:
        memo[n][k] = 1
        return memo[n][k]
    else:
        memo[n][k] = comb(n-1,k) + comb(n-1,k-1)
        return memo[n][k]

n,a,b = map(int,input().split(' '))
v = list(map(int,input().split(' ')))

v.sort()
v.reverse()
if len(set(v)) == 1:
    print(v[0])
    ans = 0
    for i in range(a,b+1):
        ans += comb(n,i) 
    print(ans)
else:
    total = 0
    for i in range(a):
        total += v[i]
    print("%.10f" % total/a)
    if a < n and v[a] == v[a-1]:
        l = r = 0
        for i in range(n):
            if v[i] == v[a]:
                if i < a:
                    l += 1
                else:
                    r += 1
        print(comb(l+r,l))
    else:
        print(1)

Fixed submission:
memo = [[0] * 60 for i in range(60)]

def comb(n,k):
    if memo[n][k] > 0:
        return memo[n][k]
    elif k == 0 or k == n:
        memo[n][k] = 1
        return memo[n][k]
    else:
        memo[n][k] = comb(n-1,k) + comb(n-1,k-1)
        return memo[n][k]

n,a,b = map(int,input().split(' '))
v = list(map(int,input().split(' ')))

v.sort()
v.reverse()
if len(set(v[:a])) == 1:
    print(v[0])
    cnt = 0
    for i in range(n):
        if v[i] == v[0]:
            cnt += 1
    ans = 0
    for i in range(a,min(b,cnt)+1):
        ans += comb(cnt,i) 
    print(ans)
else:
    total = 0
    for i in range(a):
        total += v[i]
    print("%.10f" % (total/a))
    if a < n and v[a] == v[a-1]:
        l = r = 0
        for i in range(n):
            if v[i] == v[a]:
                if i < a:
                    l += 1
                else:
                    r += 1
        print(comb(l+r,l))
    else:
        print(1)