Buggy python submission (verdict: Runtime Error):
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print res1
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a-1]):
    res2 = 0
    for i in range(a,b+1):
        res2 += nCr(v.count(v[a]),i)
    print res2
else:
    print nCr(v.count(v[a-1]),v[:a].count(v[a-1]))

Fixed submission:
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print '{0:.6f}'.format(res1)
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a-1]):
    res2 = 0
    for i in range(a,b+1):
        if i <= v.count(v[a-1]):
            res2 += nCr(v.count(v[a-1]),i)
    print res2
else:
    print nCr(v.count(v[a-1]),v[:a].count(v[a-1]))

Buggy python submission (verdict: Runtime Error):
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print res1
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a]):
    res2 = 0
    for i in range(a,b+1):
        res2 += nCr(v.count(v[a]),i)
    print res2
else:
    print nCr(v.count(v[a]),v[:a].count(v[a]))

Fixed submission:
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print '{0:.6f}'.format(res1)
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a-1]):
    res2 = 0
    for i in range(a,b+1):
        if i <= v.count(v[a-1]):
            res2 += nCr(v.count(v[a-1]),i)
    print res2
else:
    print nCr(v.count(v[a-1]),v[:a].count(v[a-1]))

Buggy python submission (verdict: Runtime Error):
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print res1
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a]):
    res2 = 0
    for i in range(a,b):
        res2 += nCr(v.count(v[i]),i)
else:
    print nCr(v.count(v[a]),v[:a].count(v[a]))

Fixed submission:
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print '{0:.6f}'.format(res1)
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a-1]):
    res2 = 0
    for i in range(a,b+1):
        if i <= v.count(v[a-1]):
            res2 += nCr(v.count(v[a-1]),i)
    print res2
else:
    print nCr(v.count(v[a-1]),v[:a].count(v[a-1]))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = 0
for i in range(a,b+1):
    s = sum(v[:i])*1.0/i
    if s > res1:
        res1 = s
print res1
res2 = 0
for i in range(a,b+1):
    for j in itertools.combinations(v,i):
        if sum(j)==res1*i:
            res2 +=1
print res2

Fixed submission:
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
v = sorted(map(int, raw_input().split()))[::-1]
res1 = sum(v[:a])*1.0/a
print '{0:.6f}'.format(res1)
res2 = 0
def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)
if a==v[:a].count(v[a-1]):
    res2 = 0
    for i in range(a,b+1):
        if i <= v.count(v[a-1]):
            res2 += nCr(v.count(v[a-1]),i)
    print res2
else:
    print nCr(v.count(v[a-1]),v[:a].count(v[a-1]))