You are given N items.

The value of the i-th item (1 \leq i \leq N) is v_i.

Your have to select at least A and at most B of these items.

Under this condition, find the maximum possible arithmetic mean of the values of selected items.

Additionally, find the number of ways to select items so that the mean of the values of selected items is maximized.  

-----Constraints-----
 - 1 \leq N \leq 50
 - 1 \leq A,B \leq N
 - 1 \leq v_i \leq 10^{15}
 - Each v_i is an integer.

-----Input-----
The input is given from Standard Input in the following format:
N A B
v_1
v_2
...
v_N

-----Output-----
Print two lines.

The first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.

The second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.

-----Sample Input-----
5 2 2
1 2 3 4 5

-----Sample Output-----
4.500000
1

The mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.

There is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.

Difficulty: interview

Starter code:

Solutions:
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
X.sort(reverse=True)
M = sum(X[i] for i in range(A)) / A
print(M)
cntl, cntr = 0, 0
if X[A-1] == X[N-1]:
  cntr = N - A
else:
  cntr = A-1
  while X[A-1] == X[cntr]:
    cntr += 1
  cntr -= A
if X[0] == X[A-1]:
  cntl = A
else:
  cntl = A-1
  while X[A-1] == X[cntl]:
    cntl -= 1
  cntl = A - 1 - cntl
F = 0
c = cntl + cntr
if cntl == A:
  t = 1
  for m in range(A):
    t *= c - m
    t //= m + 1
  for m in range(A, min(B, c)+1):
    F += t
    t *= c - m
    t //= m + 1
  print(F)
else:
  # calc comb(cntl + cntr, cntl)
  t = 1
  for m in range(cntl):
    t *= c - m
    t //= m + 1
  F = t
  print(F)

#!/usr/bin/env python3

from copy import deepcopy
from fractions import Fraction

def main():
    n, a, b = list(map(int, input().split()))
    v = list(map(int, input().split()))
    dp = [[0, 0] for i in range(n + 1)]
    dp[0] = [0, 1]
    for j in range(n):
        dppre = deepcopy(dp)
        for i in range(n):  # 配る
            vnew = dppre[i][0] + v[j]
            ways = dppre[i][1]
            if vnew > dp[i + 1][0]:
                dp[i + 1] = [vnew, ways]
            elif vnew == dp[i + 1][0]:
                dp[i + 1][1] += ways

    maxave = 0
    for i in range(a, b + 1):
        maxave = max(maxave, Fraction(dp[i][0], i))
    ways = 0
    for i in range(a, b + 1):
        if Fraction(dp[i][0], i) == maxave:
            ways += dp[i][1]
    print((float(maxave)))
    print(ways)

def __starting_point():
    main()

__starting_point()

import math
from collections import Counter
N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))

V.sort(reverse=True)
c = Counter(V)
L = []
for i in range(A, B + 1):
    L.append(sum(V[0:i]) / i)

ans = []
for i in range(A, B + 1):
    c_t = Counter(V[0:i])
    tmp = 1
    for k, v in list(c_t.items()):
        tmp *= math.factorial(c[k]
                              ) // math.factorial(v) // math.factorial(c[k] - v)
    ans.append(tmp)

max_L = max(L)

num = 0
for i in range(len(L)):
    if L[i] == max_L:
        num += ans[i]

print(('{:.6f}'.format(max_L)))
print(num)


N,A,B=map(int,input().split())
v=[int(x)for x in input().split()]
v.sort(reverse=True)
a=sum(v[:A])/A
m=min(v[:A])
k=v.count(m)
l=v.index(m)
ans=0
import math
for i in range(A,B+1):
    if i==A:
        ans+=(math.factorial(k)//math.factorial(i-l))//math.factorial(k-i+l)
    else:
        if k-i+l>=0 and a==m:
            ans+=(math.factorial(k)//math.factorial(i-l))//math.factorial(k-i+l)
        else:
            break
            
            
print("{:.6f}".format(a))
print(int(ans))  

N, A, B = map(int, input().split())
V = sorted([int(x) for x in input().split()],reverse=True)
from statistics import mean
from math import comb
maxmean = mean(V[:A])
if V[0] != V[A-1]:
    n = V.count(V[A-1])
    k = V[:A].count(V[A-1])
    way = comb(n, k)
else:
    n = V.count(V[A-1])
    way = sum(comb(n, k) for k in range(A, min(n,B)+1))
print(maxmean)
print(way)

import math
def C(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, a, b = map(int, input().split())
l = sorted(list(map(int, input().split())), reverse=True)
print(sum(l[:a])/a)
if l.count(l[a-1]) > 1:
    ans = 0
    x = l[a-1]
    y = l[:a].count(x)
    z = l.count(x)
    if l[0] != x:
        print(C(z, y))
    else:
        ans = 0
        for i in range(a, min(b, z)+1):
            ans += C(z, i)
        print(ans)
else:
    print(1)

C = [[0 for j in range(51)] for i in range(51)]
for i in range(51):
    C[i][0] = 1
for i in range(1, 51):
    for j in range(1, 51):
        C[i][j] = C[i - 1][j - 1] + C[i - 1][j]
n, a, b = list(map(int, input().split()))
*V, = list(map(int, input().split()))
V.sort(reverse=True)
print((sum(V[:a]) / a))
if V[0] == V[a - 1]:
    x = V.count(V[a - 1])
    print((sum([C[x][y] for y in range(a, b + 1)])))
else:
    x = V.count(V[a - 1])
    y = a - len([v for v in V if v > V[a - 1]])
    print((C[x][y]))


import sys
inp = lambda: sys.stdin.readline()
mi = lambda: map(int, inp().split())
li = lambda: list(map(int, inp().split()))
mf = lambda: map(float,inp().split())
lf = lambda: list(map(float,inp().split()))

def nCk(n,k):
    u,s = 1,1
    for i in range(n - k + 1,n + 1):u *= i
    for i in range(1,k + 1):s *= i
    return u // s
N,A,B = mi()
vec = lf()
vec.sort()
vec = vec[::-1]
avr = 0.0
for i in range(A):
    avr += vec[i]
avr /= A
print("{:.08f}".format(avr))
kosu = vec.count(vec[A - 1])
#print(kosu)
if kosu == 1:
    print(1)
    return
if vec[0] == vec[A - 1]:
    ans = 0
    for i in range(A,B + 1):
        if vec[i - 1] != vec[0]:
            break
        ans += nCk(kosu,i)
    print(ans)
else:
    K = vec[:A].count(vec[A - 1])
    print(nCk(kosu,K))

from collections import Counter
n,a,b=list(map(int,input().split()))
v=list(map(int,input().split()))
v.sort(reverse=True)
su=sum(v[:a])
avg=su/a
tot=0
inside=0
c=[ [0]*51 for _ in range(51)]
for i in range(n+1):
    for j in range(i+1):
        if j==0 or j==i:
            c[i][j]=1
        else:
            c[i][j]=c[i-1][j]+c[i-1][j-1]
for i in range(n):
    if v[i]==v[a-1]:
        tot+=1
        if i<a:
            inside+=1
cnt=0
if inside==a:
    for i in range(a,b+1):
        cnt+=c[tot][i]
else:
    cnt+=c[tot][inside]
print(avg)
print(cnt)

        




def ncr(n,r):
    g = 1
    for i in range(1,r+1):
        g*=(n-r+i)
        g//=i
    return g
n,a,b= map(int,input().split())
nv = sorted(list(map(int,input().split())),reverse=True)
print(sum(nv[:a])/a)
ndica = {}
ndicfull = {}
conti = 0
fnv=nv[0]
for i,temp in enumerate(nv):
    if i<a:ndica[temp] = ndica.get(temp,0) + 1
    ndicfull[temp] = ndicfull.get(temp,0) + 1
    if temp==fnv:conti=i+1
if fnv == nv[a-1]:
    subb = min(conti,b)
    g=0
    for t in range(a,subb+1):g+=ncr(conti,t)
    print(g)
else:
    if ndicfull[nv[a-1]]==1:print(1)
    else:print(ncr(ndicfull[nv[a-1]],ndica[nv[a-1]]))

comb_memo = {}
def comb(n, r):
  nonlocal comb_memo
  if (n, r) in comb_memo:
    return comb_memo[(n, r)]
  else:
    r = min(r, n-r)
    res = 1
    for _ in range(r):
      res *= n
      n -= 1
    for i in range(1, r+1):
      res //= i
    comb_memo[(n, r)] = res
    comb_memo[(n, n-r)] = res
    return res

N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

mu = sum(v[:A]) / A
ans = 0
if v[0] == mu:
  R = v.count(v[0])
  for i in range(A, B+1):
    if i > R:
      break
    ans += comb(R, i)
else:
  min_v = v[A-1]
  n = v.count(min_v)
  need = v[:A].count(min_v)
  ans += comb(n, need)

print(mu)
print(ans)

n,a,b=map(int,input().split())
v=list(map(int,input().split()))
fact=[1]
for i in range(1,51):
    fact.append(i*fact[-1])
def cmb(n,r):
    return fact[n]//(fact[n-r]*fact[r])
v.sort(reverse=True)
print(sum(v[:a])/a)
cntv,cntr=0,0
for i in range(n):
    if i<a:
        if v[i]==v[a-1]:
            cntv+=1
    else:
        if v[i]==v[a-1]:
            cntr+=1
#print(cntv,cntr)
if cntv<a:
    print(cmb(cntv+cntr,cntv))
else:
    ans=0
    for r in range(a,min(b,cntv+cntr)+1):
        ans+=cmb(cntv+cntr,r)
        #print(ans)
    print(ans)

from math import factorial

N, A, B = list(map(int, input().split()))
V = [int(i) for i in input().split()]
V.sort(reverse=True)

a = 0
for i in range(A):
    a += V[i]
a /= A
print(a)

c = 0

if V[0] != V[A-1]:
    r = 0
    while True:
        r += 1
        if V[A-1-r] != V[A-1]:
            break
    n = 0
    while True:
        if A+n > N-1:
            break
        if V[A+n] != V[A-1]:
            break
        n += 1
    n += r
    c = round(factorial(n) / factorial(r) / factorial(n-r))

else:
    n = 0
    while True:
        n += 1
        if n > N-1:
            break
        if V[n] != V[0]:
            break
    B = min(B, n)
    for i in range(B-A+1):
        c += round(factorial(n) / factorial(A+i) / factorial(n-A-i))

print(c)


import collections
import math

N, A, B = list(map(int, input().split()))
v = list(map(int, input().split()))
d = list(reversed(sorted(v)))
c = collections.Counter(v)

start = A
end = A
if c[d[0]] >= A:
  end = min(c[d[0]], B)
  
ans = 0
ans_com = 0
for i in range(start, end+1):
  sel = i
  com = 1
  total = 0
  for j in range(len(d)):
    p = c[d[j]]
    com *= math.factorial(p)
    total += d[j] * p
    if sel <= p:
      com /= (math.factorial(sel) * math.factorial(p-sel))
      total -= d[j] * (p - sel)
      break
    sel -= p
  ave = total / i
  ans = ave
  ans_com += int(com)
print(ans)
print(ans_com)


from collections import defaultdict

# Combination
MOD = 10**17+3
MAX = 2*10**5
fac = [1,1] + [0]*MAX
finv = [1,1] + [0]*MAX
inv = [0,1] + [0]*MAX
for i in range(2,MAX+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def comb(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse=True)
arr = V[:A]
se = set()
mi = 10**18
dic2 = defaultdict(int)
tot = 0
for a in arr:
    tot += a
    dic2[a] += 1
    se.add(a)
    if a < mi:
        mi = a
dic = defaultdict(int)
for v in V:
    dic[v] += 1
if len(se) == 1:
    ans = 0
    for i in range(A, B+1):
        ans += comb(dic[mi], i)
else:
    ans = comb(dic[mi], dic2[mi])
print((tot/A))
print(ans)


from bisect import bisect_left, bisect_right
from decimal import Decimal
from scipy.special import comb
n, a, b = map(int, input().split())
v = list(map(lambda x:-int(x), input().split()))
v.sort()
li = [[None]*2 for _ in range(n+1)]
for k in range(a, b+1):
    li[k][0] = -sum(v[:k])
    li[k][1] = comb(bisect_right(v, v[k-1])-bisect_left(v, v[k-1]), k-bisect_left(v, v[k-1]), exact=True)
ans = [Decimal(0), 0]
for i in range(n+1):
    if li[i][0] is None:
        continue
    tmp = Decimal(li[i][0]) / Decimal(i)
    if ans[0]==tmp:
        ans[1] += li[i][1]
    elif ans[0]<tmp:
        ans[0] = tmp
        ans[1] = li[i][1]
print(ans[0])
print(ans[1])

N,A,B=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
a=v[:A]
b=v[:B]
avg=sum(a)/A
print(avg)
c=[[0]*51 for _ in range(51)]
c[0][0]=1
for i in range(50):
  c[i+1][0]=1
  c[i+1][i+1]=1
  for j in range(i):
    c[i+1][j+1]=c[i][j]+c[i][j+1]
if a[0]==a[-1]:
  ans=0
  x=v.count(a[0])
  for i in range(A,B+1):
    if i<=x:
      ans+=c[x][i]
else:
  x=v.count(a[-1])
  y=a.count(a[-1])
  ans=c[x][y]
print(ans)

from math import factorial as f
def comb(n, k):
  return f(n)//f(k)//f(n-k)

n, a, b = map(int, input().split())
V = sorted(map(int, input().split()))
s = sum(V[-a:]) / a
print(s)
small = V[-a]
cnt = V[-a:].count(small)
total = V.count(small)
if V[-1] != small:
  ans = comb(total, cnt)
else:
  ans = 0
  for i in range(a, min(b, total)+1):
    ans += comb(total, i)
print(ans)

import math


def check(m, A, V):
    # whether we can get `m` for mean of values
    cnt, x = 0, 0
    for v in V[:A]:
        x += v - m
        cnt += 1
    return x >= 0


def comb(n, k):
    if k > n - k:
        return comb(n, n - k)
    return math.factorial(n) // math.factorial(k) // math.factorial(n - k)


def main():
    N, A, B = list(map(int, input().split(' ')))
    V = list(map(int, input().split(' ')))
    V.sort(reverse=True)
    # calculate max average value by binary search
    eps = 10 ** (-15)
    ok, ng = 0, 10 ** 16
    while (ng - ok) / ng > eps:
        mid = (ok + ng) / 2
        if check(mid, A, V):
            ok = mid
        else:
            ng = mid
    ans_v = ok
    # calculate pattern number
    min_target_v = V[A - 1]
    target_v_cnt = sum([1 if v == min_target_v else 0 for v in V])
    selected_target_v_cnt = sum([1 if v == min_target_v else 0 for v in V[:A]])
    ans_pattern = comb(target_v_cnt, selected_target_v_cnt)
    if V[0] == min_target_v:  # V[0] == ... == V[A - 1]
        # the average does not change if we add another item with min_target_v
        for i in range(1, B - A + 1):
            if target_v_cnt < selected_target_v_cnt + i:
                break
            ans_pattern += comb(target_v_cnt, selected_target_v_cnt + i)
    # answer
    print(ans_v)
    print(ans_pattern)


def __starting_point():
    main()
__starting_point()

import math
N,A,B=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
dic={}
for i in range(N):
  v=a[i]
  if v not in dic.keys():
    dic[v]=1
  else:
    dic[v]+=1
tmp=0
num_used={}
m=10**18
M=-1
for i in range(A):
  v=a[i]
  m=min(m,v)
  M=max(M,v)
  tmp+=v
  if v not in num_used.keys():
    num_used[v]=1
  else:
    num_used[v]+=1
max_ave=tmp/A
print(max_ave)
if num_used[m]==dic[m]:
  print(1)
elif m==M:
  x=dic[m]
  y=num_used[m]
  cnt=0
  for i in range(y,min(x+1,B-A+y+1)):
    cnt+=math.factorial(x)//math.factorial(i)//math.factorial(x-i)
  print(cnt)
else:
  x=dic[m]
  y=num_used[m]
  cnt=math.factorial(x)//math.factorial(y)//math.factorial(x-y)
  print(cnt)

from collections import Counter


def binomial_coefficient(n, r):
    res = 1
    for i in range(r):
        res *= (n - i)
        res //= (i + 1)
    return res


N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse=True)

C = Counter(V)

ave = sum(V[:A]) / A
num = V[A - 1]
Nnums = C[num]

if num == V[0]:
    B = min(B, Nnums)
    cnt = 0
    for i in range(A, B + 1):
        cnt += binomial_coefficient(Nnums, i)
else:
    for k, v in list(C.items()):
        if k > num:
            A -= v
    cnt = binomial_coefficient(Nnums, A)

print(ave)
print(cnt)


import sys
from collections import Counter

def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact

N, A, B = map(int,input().split())
V = list(map(int,input().split()))

c1 = Counter(V)

V.sort(reverse = True)

if all([V[0] == i for i in V[:A]]):
    print(V[0])
    ans = 0
    for i in range(A-1, B):
        if V[i] != V[0]:
            break
        ans += factorial(c1[V[0]])//(factorial(c1[V[0]]-(i+1))*factorial(i+1))
    print(ans)
    return

print(sum(V[:A]) / A)

c2 = Counter(V[:A])

print(factorial(c1[V[A-1]])//(factorial(c1[V[A-1]]-c2[V[A-1]])*factorial(c2[V[A-1]])))

from math import factorial

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

v.sort(reverse = True)

ans = sum(v[:a]) / a
ans2 = 0

count1 = v.count(v[a-1])

index1 = v.index(v[a-1])

def ncr(x,y):
    return factorial(x) // factorial(y) // factorial(x-y)

if v[0] == v[a-1]:
    for i in range(a, min(b, count1) + 1):
        ans2 += ncr(count1, i)
else:
    ans2 = ncr(count1, a - index1)

print(ans)
print(ans2)


#!python3

LI = lambda: list(map(int, input().split()))

# input
N, A, B = LI()
V = LI()

MAX = 51
finv = [None] * MAX


def comb_init():
    finv[0] = 1
    for i in range(1, MAX):
        finv[i] = finv[i - 1] * i


def comb(n, k):
    return finv[n] // finv[k] // finv[n - k]


def main():
    comb_init()
    V.sort(reverse=True)
    s = sum(V[:A])
    mx = s // A if s % A == 0 else s / A
    print(mx)
    if A == N or V[A - 1] > V[A]:
        print((1))
        return
    
    x = V.count(V[A])
    ans = 0
    if mx == V[A]:
        for i in range(A, B + 1):
            ans += comb(x, i)
    else:
        y = V[:A].count(V[A])
        ans = comb(x, y)
    print(ans)


def __starting_point():
    main()

__starting_point()

from operator import mul
from functools import reduce
def sml_cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
def main():
    n, a, b = map(int, input().split())
    v = list(map(int, input().split()))
    v.sort()
    ave = 0
    for i in range(1, a+1):
        ave += v[n-i]
    ave /= a
    l, r = -1, -1
    target = v[n-a]
    for i in range(n):
        if v[i] == target:
            l = i
            break
    for i in reversed(range(n)):
        if v[i] == target:
            r = i
            break
    cnt = r-l+1
    high, low = min(cnt, r-(n-b)+1), r-(n-a)+1
    ans = sml_cmb(cnt, low)
    if v[n-a] == v[n-1]:
        for i in range(low+1, high+1):
            ans += sml_cmb(cnt, i)
    print(ave)
    print(ans)

def __starting_point():
    main()
__starting_point()

N, A, B = list(map(int, input().split()))
v = list(map(int, input().split()))
v = sorted(v,reverse=True)

# (合計, 個数)
max_avg = (sum(v[:A]), A)

t = v[A-1]
num1 = v[:A].count(t)
num2 = v[A:].count(t)

fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=170141183460469231731687303715884105727

def combination(n,fact,ifact):
    fact[0] = 1
    fact[1] = 1
    ifact[0] = 1
    ifact[1] = 1
    inv[1] = 1
    for i in range(2,n+1):
        fact[i] = (fact[i-1]*i)%p
        inv[i] = p - inv[p%i]*(p//i)%p
        ifact[i] = (ifact[i-1]*inv[i])%p
def op(n,k):
    if k<0 or k>n or n<0:
        return 0
    return (fact[n]*ifact[k]*ifact[n-k])%p

combination(N,fact,ifact)

res = int(op(num1+num2, num1))
if v[0]==v[-1]:
    res = 0
    for i in range(A,B+1):
        res += int(op(N, i))
elif v[0] == v[B-1]:
    res = 0
    for i in range(A, B+1):
        res += int(op(num1+num2,i))
elif v[0] == v[A-1]:
    res = 0
    for i in range(A, min(B, A+num2)+1):
        res += int(op(num1+num2, i))
print((max_avg[0]/max_avg[1]))
print(res)




from collections import defaultdict

def comb(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    res = 1
    for i in range(r):
        res *= n
        n -= 1
    for i in range(1,r+1):
        res //= i
    return res

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse=True)
mi = 10**18
dic = defaultdict(int)
dic2 = defaultdict(int)
tot = 0
for i,a in enumerate(V):
    if i < A:
        tot += a
        dic2[a] += 1
        if a < mi:
            mi = a
    dic[a] += 1
if len(dic2) == 1:
    ans = 0
    for i in range(A, B+1):
        ans += comb(dic[mi], i)
else:
    ans = comb(dic[mi], dic2[mi])
print((tot/A))
print(ans)


def main():
    from decimal import Decimal

    N, A, B = list(map(int, input().split()))
    *v, = list(map(Decimal, input().split()))

    v.sort(reverse=True)

    max_average = sum(v[:A]) / A

    tail = v[A - 1]
    contained = [0] * (N + 1)
    s = 0
    for i, x in enumerate(v, start=1):
        if x == tail:
            s += 1
        contained[i] = s

    def choose(n, a):
        x, y = 1, 1
        for i in range(a):
            x = x * (n - i)
            y = y * (i + 1)
        return x // y

    count = 0
    for k in range(A, B + 1):
        if (k > A) and (v[k - 1] != max_average): break
        count += choose(contained[-1], contained[k])

    print(max_average)
    print(count)


def __starting_point():
    main()

__starting_point()

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)

if len(set(v)) == 1:
    print(1)
    print(1125899906842623)
    return

m = sum(v[:A])/A
print(m)

if len(set(v[:A]))==1:
    ans = 0
    c = v.count(v[0])
    for i in range(A,B+1):
        if i <= c:
            ans += cmb(c,i)
    print(ans)
    return

mi = min(v[:A])
n = v[:A].count(mi)
m = v.count(mi)
print(cmb(m,n))

def comb(n, r):
    x, y = 1, 1
    for i in range(n, n - r, -1):
        x *= i
        y *= i + r - n
    return x // y

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse = True)
c = b - a + 1
s = [0] * c
for i in range(c):
    s[i] = sum(v[0 : a + i]) / (a + i)
m = max(s)
ans = 0
for i in range(c):
    if s[i] == m:
        r = v[0 : a + i].count(v[a + i - 1])
        l = v.count(v[a + i - 1])
        ans += comb(l, min(r, l - r))
print(m)
print(ans)

def main():
    from decimal import Decimal

    N, A, B = list(map(int, input().split()))
    *v, = list(map(Decimal, input().split()))

    v.sort(reverse=True)

    max_average = sum(v[:A]) / A

    tail = v[A - 1]
    contained = [0] * (N + 1)
    s = 0
    for i, x in enumerate(v, start=1):
        if x == tail:
            s += 1
        contained[i] = s

    def choose(n, a):
        if n - a < a:
            return choose(n, n - a)
        x, y = 1, 1
        for i in range(a):
            x = x * (n - i)
            y = y * (i + 1)
        return x // y

    count = 0
    for k in range(A, B + 1):
        if (k > A) and (v[k - 1] != max_average): break
        count += choose(contained[-1], contained[k])

    print(max_average)
    print(count)


def __starting_point():
    main()

# editorial
# K個選んだときの品物の価値の平均の最大値と
# K+1個個選んだときの品物の価値の平均の最大値の差を比較

# v[:A]は一つの値からなる->平均値を下げずに要素を追加できる可能性
# v[:A]は異なる値を含む->範囲外の値はより小さいので要素を追加できない

__starting_point()

import itertools, bisect
from fractions import Fraction
from math import factorial


def comb(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r))


N, A, B = list(map(int, input().split()))
V = sorted(list(map(int, input().split())), reverse=True)

Ave = [Fraction(a, i) for i, a in enumerate(itertools.accumulate(V), 1)]
max_num = max(Ave[A - 1:B])
max_indices = [i for i, v in enumerate(Ave) if A <= i + 1 <= B and v == max_num]

Vm = [-v for v in V]
C = 0
for ind in max_indices:
    l = bisect.bisect_left(Vm, Vm[ind])
    r = bisect.bisect_right(Vm, Vm[ind])
    C += comb(r - l, ind - l + 1)
print((float(max_num)))
print(C)


#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
#from scipy.misc import comb

N,A,B = map(int, input().split())
v = sorted(list(map(int, input().split())), reverse=True)

ans = 0
for i in range(A,B+1):
    ans = max(sum(v[:i])/i, ans)

cnt = 0
for i in range(A,B+1):
    if sum(v[:i])/i == ans:
        n = v.count(v[i-1])
        r = i-v.index(v[i-1])
        cnt += math.factorial(n)//math.factorial(r)//math.factorial(n-r)

print(ans)
print(cnt)

import math
def nCr(n,r):
    return (math.factorial(n)//(math.factorial(r)*math.factorial(n-r)))
N, A, B = list(map(int,input().split()))
v = sorted(list(map(int,input().split())), reverse = True)
print((sum(v[:A])/A))

t = v[A-1]
m, u = 0, 0
for k in range(A):
    if v[k] == t:
        m += 1
for k in range(A,N):
    if v[k] == t:
        u += 1
if m == A:
    ans = 0
    for k in range(A,min(A+u+1,B+1)):
        ans += nCr(m+u,k)
    print(ans)
else:
    print((nCr(m+u,m)))


import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = 10**6#float('inf')
#mod = 10 ** 9 + 7 
mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

#階乗#
lim = 50
fact = [1] * (lim+1)
for n in range(1, lim+1):
	fact[n] = n * fact[n-1]

def C(n, r):
	return fact[n]//fact[n-r]//fact[r]


N, A, B = MAP()
v = sorted(LIST(), reverse=True)
key = v[A-1]
print(sum(v[:A])/A)

v = v[::-1]
n = bisect(v, key) - bisect_left(v, key)
m = N - bisect(v, key)


if m == 0:
	ans = 0
	for i in range(A, min(B-m, n)+1):
		ans += C(n, i)
	print(ans)
else:
	print(C(n, A-m))

from collections import Counter
def nCr(n, r):
    t = 1
    for i in range(n - r + 1, n + 1):
        t *= i
    for i in range(2, r + 1):
        t //= i
    return t

def main():
    N, A, B = list(map(int, input().split()))
    V = list(map(int, input().split()))
    VV = Counter(V)
    m = 0
    c = 0
    for v in sorted(list(VV.keys()), reverse=True):
        vc = VV[v]
        if c + vc <= A:
            m += v * vc
            c += vc
            continue
        break
    else:
        print((m / c))
        print((1))
        return
    min_c = A - c
    max_c = min(B - c, vc)
    m += v * min_c
    c += min_c
    print((m / c))
    if m != c * v:
        max_c = min_c
    r = 0
    for i in range(min_c, max_c + 1):
        r += nCr(vc, i)
    print(r)

main()


import sys
input = sys.stdin.readline

def main():
    N,A,B = list(map(int,input().split()))
    v = sorted(list(map(int,input().split())),reverse=True)
    use = v[:A]
    print((sum(use)/A))
    fac = [0 for _ in range(N+1)]
    fac[0],fac[1] = 1,1
    
    for i in range(2,N+1):
        fac[i] = (fac[i-1]*i)

    x = v.count(v[A-1])
    y = use.count(use[A-1])
    
    if v[0] == v[A-1]:
        ans = 0
        for i in range(A,min(B,x)+1):
            ans += fac[x]//(fac[i]*fac[x-i])
        print(ans)
    else:
        ans = fac[x]//(fac[y]*fac[x-y])
        print(ans)

def __starting_point():
    main()

__starting_point()

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
n,a,b=map(int,input().split())
v=sorted(list(map(int,input().split())),reverse=1)
tmp=sum(v[:a])
ans=(tmp,a)
x=[a-1]
for i in range(a,b):
    tmp+=v[i]
    if ans[0]*(i+1)<=ans[1]*tmp:
        if ans[0]*(i+1)==ans[1]*tmp:
            x.append(i)
        else:
            x=[i]
print(ans[0]/ans[1])
ans=0
for i in x:
    a,b=v.count(v[i]),v[i+1:].count(v[i])
    ans+=comb(a,b)
print(ans)

from collections import Counter
from math import factorial


N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
C = Counter(V)
keys = list(C.keys())
keys.sort(reverse=True)

if C[keys[0]] >= A:
    mean = keys[0]
    var = 0
    for i in range(A, min(B, C[keys[0]]) + 1):
        var += factorial(C[keys[0]]) // factorial(i) // factorial(C[keys[0]] - i)
else:
    cnt = 0
    total = 0
    var = 0
    for v in keys:
        if cnt + C[v] < A:
            cnt += C[v]
            total += v * C[v]
        else:
            total += v * (A - cnt)
            mean = total / A
            var += factorial(C[v]) // factorial((A - cnt)) // factorial(C[v] - (A - cnt))
            break

print(mean)
print(var)


from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,A,B=map(int,readline().split())
    v=list(map(int,readline().split()))
    v.sort(reverse=True)

    #average
    average=sum(v[:A])/A

    #combination
    res=0
    x=v[A-1]
    x_count=v.count(x)
    x_count_copy=x_count
    if x==v[0]:
        up=1
        down=1
        for i in range(1,A):
            up*=x_count_copy
            x_count_copy-=1
            down*=i
        if x_count>=B:
            for i in range(A,B+1):
                up*=x_count_copy
                x_count_copy-=1
                down*=i
                res+=up//down
        else:
            for i in range(A,x_count+1):
                up*=x_count_copy
                x_count_copy-=1
                down*=i
                res+=up//down
    else:
        m=A
        for i in range(A):
            if v[i]>x:
                m-=1
            else:
                break
        up=1
        down=1
        for i in range(1,m+1):
            up*=x_count_copy
            x_count_copy-=1
            down*=i
        res=up//down

    print(average)
    print(res)
    
def __starting_point():
    main()
__starting_point()

import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N, A, B = map(int, input().split())
V = list(map(int, input().split()))

dp = [-1] * (N + 1)
dp[0] = 0
cnt = [0] * (N + 1)
cnt[0] = 1

for i in range(N):
    for j in range(N, 0, -1):
        if dp[j - 1] < 0:
            continue
        if dp[j] < dp[j - 1] + V[i]:
            dp[j] = dp[j - 1] + V[i]
            cnt[j] = cnt[j - 1]
        elif dp[j] == dp[j - 1] + V[i]:
            cnt[j] += cnt[j - 1]

up = -1
btm = -1
s = 0

for i in range(A, B + 1):
    if dp[i] < 0:
        continue
    if up < 0:
        up, btm = dp[i], i
        s = cnt[i]
    elif up * i < dp[i] * btm:
        up, btm = dp[i], i
        s = cnt[i]
    elif up * i == dp[i] * btm:
        s += cnt[i]


print(up / btm)
print(s)

def d_maximum_average_sets():
    from functools import reduce
    N, A, B = [int(i) for i in input().split()]
    V = sorted([int(i) for i in input().split()], reverse=True)

    def combination(n, r):
        numerator = reduce(lambda x, y: x * y, range(n, n - r, -1))
        denominator = reduce(lambda x, y: x * y, range(1, r + 1))
        return numerator // denominator

    if V[0] == V[A - 1]:  # V の上位 A 個がすべて同じ値 (v_max とおく)
        # V で値が v_max である x 個から A 個以上 B 個以下選ぶ
        x = V.count(V[0])
        count = sum([combination(x, i) for i in range(A, B + 1)])
    else:
        # 上位 A 個のうち最も値が小さな要素の値を v_min とおき、
        # v_min が上位 A 個のうち a 個あったとする。
        # V で値が v_min である x 個から a 個選ぶ。
        v_min = V[A-1]
        x, a = V.count(v_min), V[:A].count(v_min)
        count = combination(x, a)
    return '{}\n{}'.format(sum(V[:A]) / A, count)

print(d_maximum_average_sets())

import collections
from operator import mul
from functools import reduce

N,A,B = list(map(int, input().split()))
V = list(map(int, input().split()))
VV = sorted(V,reverse = True)
ave = 0
ml = []

for i in range(A,B + 1):
  avet = sum(VV[:i]) / i
  if avet >= ave:
    ml.append(i)
    ave = max(ave,avet)
  else:
    break

dic = collections.Counter(V)
#print(dic,ml)

def cmb(n,r):
  r = min(n - r,r)
  if r == 0:
    return 1
  over = reduce(mul,list(range(n, n - r, -1)))
  under = reduce(mul,list(range(1,r + 1)))
  return over // under

res = 0

for j in ml:
  r = dic[VV[j - 1]]
  rr = VV.index(VV[j - 1])
  res += cmb(r,j - rr)

print(ave)
print(res)


N,A,B=map(int, input().split())
D=list(map(int, input().split()))
D=sorted(D)[::-1]
import math
from math import comb
print(sum(D[:A])/A)
ans=0
if D[0]!=D[A-1]:
  n=D.count(D[A-1])
  k=D[:A].count(D[A-1])
  print(comb(n,k))
else:
  ans=0
  n=D.count(D[A-1])
  for i in range(A,min(n,B)+1):
    ans+=comb(n,i)
  print(ans)

N, A, B = list(map(int, input().split()))
v = list(map(int, input().split()))
v.sort()

AAA = sum(v[N-A:])/A
print(AAA)

p = 0
import math
for i in range(A,B+1):
    ans = v[N-i:]
    if sum(ans)/i == AAA:
        rest = v[:N-i]
        m = ans.count(ans[0])
        n = rest.count(ans[0])
        C = math.factorial(n+m)//(math.factorial(m)*math.factorial(n))
        p += C

print(p)


def main():
    N,A,B=list(map(int,input().split()))
    v=list(map(int,input().split()))
    v.sort(reverse=True)
    Amxv=sum(v[:A])
    c=v[A-1]
    m=v[:A].count(c) 
    n=v.count(c)
    fl=[1]*(N+1)
    for i in range(N):
        fl[i+1]=fl[i]*(i+1)
    print((Amxv/A))
    if v[0]-c==0:
        print((sum([fl[n]//(fl[i]*fl[n-i]) for i in range(A,min(B,n)+1)])))
    else:
        print((fl[n]//(fl[m]*fl[n-m])))

def __starting_point():
    main()
    

__starting_point()

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

count = {}
for x in v:
    if x in count:
        count[x] += 1
    else:
        count[x] = 1

fact = [1] * 51
for i in range(1, 51):
    fact[i] = fact[i-1] * i

def comb(a, b):
    return fact[a] // fact[a-b] // fact[b]

ans = 0
if v[0] == v[a-1]:
    b = min(b, count[v[0]])
    for i in range(a, b+1):
        ans += comb(count[v[0]], i)
    print(v[0])
    print(ans)
else:
    c = v[:a].count(v[a-1])
    print(sum(v[:a]) / a)
    print(comb(count[v[a-1]], c))

class cmbs(object):
    def __init__(self, mod=9007199254740997):
        self.mod = mod
        self.g1 = [1, 1]
        self.g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, 10 ** 2 + 1):
            self.g1.append((self.g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            self.g2.append((self.g2[-1] * inverse[-1]) % mod)

    def cmb(self, n, r):
        if n > 10 ** 6:
            return self.cmbl(n, r)
        return self.cmbr(n, r)

    def cmbr(self, n, r):
        if r < 0 or r > n:
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.mod

def main():
    N, A, B = list(map(int, input().split()))
    v = list(map(int, input().split()))
    v.sort(reverse=True)
    m = sum(v[:A])/A
    print(m)
    if v.count(v[A-1]) == N:
        c = cmbs()
        a = 0
        for i in range(A, B+1):
            a += c.cmb(N, i)
        print(a)
    elif v[0] == v[A-1]:
        c = cmbs()
        a = 0
        for i in range(A, min(v.count(v[A-1]), B) + 1):
            a += c.cmb(v.count(v[A-1]), i)
        print(a)
    elif v.count(v[A-1]) == 1:
        print((1))
    else:
        c = cmbs()
        r = A - v.index(v[A-1])
        print((c.cmb(v.count(v[A-1]), r)))
main()


N,A,B=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=1)
s=sum(v[:A])
print(s/A)
from math import factorial
t=v[A-1]
p,q=0,0
for i in v:
    if i>t:
        p+=1
    elif i==t:
        q+=1
a=0
def c(n,k):
    return (factorial(n)//factorial(k)//factorial(n-k))
for i in range(A,B+1):
    if p+q>=i:
        a+=c(q,i-p)
    if t!=v[0]:
        break
print(a)

from math import comb
mod = 10 ** 9 + 7
n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
print(sum(v[:a]) / a)
if v[0] != v[a - 1]:
    cur = v[a - 1]
    cnt = 0
    for i in range(n):
        if cur == v[i]:
            cnt += 1
    cnt2 = 0
    for i in range(a):
        if cur == v[i]:
            cnt2 += 1
    print(comb(cnt, cnt2))
else:
    cur = v[a - 1]
    cnt = 0
    for i in range(n):
        if cur == v[i]:
            cnt += 1
    ans = 0
    for i in range(a, b + 1):
        ans += comb(cnt, i)
    print(ans)

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse = True)

total = sum(V[:A])

ave = total / A

tmp = V[A - 1]

count = V.count(tmp)

def combination(n, r): #nCrを求める
    if n - r > r:
        r = n - r
    tmp = 1
    for i in range(n - r + 1, n + 1):
        tmp *= i
    for i in range(1, r + 1):
        tmp //= i
    return tmp





if V[0] == V[A - 1]: #上からA個が同じ
    ans = 0
    for i in range(A, min(B, count) + 1):
        ans += combination(count, i)

else: #A個ちょうど取るのがいいとき
    count2 = V[:A].count(tmp)
    ans = combination(count, count2)

print (ave)
print (ans)


import statistics
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,a,b = list(map(int,input().strip().split()))
v = list(map(int,input().strip().split()))
v.sort(reverse=True)

result = 0
mean_min = statistics.mean(v[0:a])
for i in range(a,b+1):
  st_mean = statistics.mean(v[0:i])
  if mean_min == st_mean:
    v_n = v.count(v[a])
    v_r = v[0:i].count(v[a])
    result += combinations_count(v_n,v_r)
  else:
    break
print(mean_min)
print(result)

from collections import Counter

def comb(n,r):
    if n<r: return 0
    comb = 1
    r = min(r,n-r)
    for i in range(r):
        comb = comb * (n-i) // (i+1)
    return comb


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

v.sort(reverse=True)

va_count = Counter(v[:a])
v_count  = Counter(v)

print(sum(v[:a])/a)

if v[0] == v[a-1]:
    print(sum(comb(v_count[v[0]],i ) for i in range(a,b+1)))
else:
    print(comb(v_count[v[a-1]], va_count[v[a-1]]))

n,a,b=map(int,input().split())
v=list(map(int,input().split()))
v.sort()
max_mean=sum(v[-a:])/a
print(max_mean)
from collections import Counter
cva=Counter(v[-a:])
cv=Counter(v)
import math
def ncr(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 選んだa個が全て同じ値なら
if v[-a]==max_mean:
  ans=0
  for k in range(a,min(b,cv[v[-a]])+1):
    ans+=ncr(cv[v[-a]],k)
  print(ans)
else:
  # aの中で一番小さな数字は何個あるか。
  k0=cva[v[-a]]
  k1=cv[v[-a]]
  ans=ncr(k1,k0)
  print(ans)

import sys
from collections import Counter
from itertools import product
from random import randint

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def debug(n, a, b, V, ave):
    cnt = 0
    for pattern in product([0, 1], repeat=n):
        if a <= sum(pattern) <= b:
            tot = 0
            for idx, p in enumerate(pattern):
                if p == 1:
                    tot += V[idx]
            res = tot / sum(pattern)
            if abs(res - ave) <= 10 ** -6:
                cnt += 1
    return cnt


def resolve():
    n, a, b = list(map(int, input().split()))
    V = list(map(int, input().split()))

    V.sort(reverse=True)
    ave = 0
    for i in range(a, b + 1):
        tot = sum(V[:i])
        if ave <= tot / i:
            ave = tot / i
            used = V[:i]

    if len(set(used)) == 1:
        cnt = V.count(used[0])
        ave = used[0]
        cmb = [0] * len(used)
        for i in range(a, len(used) + 1):
            x = y = 1
            for j in range(1, i + 1):
                x *= (cnt + 1 - j)
                y *= j
            cmb[i - 1] = x // y
        res = sum(cmb)
    else:
        use_cnt = Counter(used)
        used = set(used)
        D = Counter(V)
        res = 1
        for num in used:
            cnt = use_cnt[num]
            x = y = 1
            for j in range(1, cnt + 1):
                x *= (D[num] + 1 - j)
                y *= j
            res *= x // y
    print(ave)
    print(res)
    # print(debug(n, a, b, V, ave))


def __starting_point():
    resolve()

__starting_point()

from collections import Counter

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse=True)

S = sum(V[:A])
cnt = A
mx = S / cnt
L = [cnt]

for v in V[A:]:
    if cnt == B:
        break
    cnt += 1
    S += v
    if mx < S / cnt:
        mx = S / cnt
        L = []
    if mx == S / cnt:
        L.append(cnt)

def ncr(n, r):
    ret = 1
    for i in range(r):
        ret *= (n - i)
    for i in range(1, r + 1):
        ret //= i
    return ret

print(mx)
ans = 0
cntV = Counter(V)
for c in L:
    cnt = Counter(V[:c])
    prd = 1
    for x, c in list(cnt.items()):
        prd *= ncr(cntV[x], c)
    ans += prd
print(ans)


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

V.sort(reverse = True)
s = 0
m = V[a-1]
ans = sum(V[:a])/a
print(ans)
cnt = V.count(m)
left = V.index(m)
ans = 0
memo = {}
def combi(m,k):
    if m*100+k in memo:
        return memo[m*100+k]
    elif k == 0:
        return 1
    else:
        memo[m*100+k] = combi(m,k-1)*(m-k+1)//k
        return memo[m*100+k]

if left == 0:
    for i in range(a,min(b,cnt)+1):
        ans += combi(cnt,i)
else:
    ans += combi(cnt,a-left)
    # if (sum(V[:a])/a).is_integer():
    #     ans *= pow(2,V.count(int(V[:a]/a)))
print(ans)


#mAx average set
n,a,b=map(int,input().split())
lists=list(map(int,input().split()))
lists=sorted(lists)
P=sum(lists[-a:])
print(P/a)
#Bことって総和がminiになっている
from collections import Counter
J=dict(Counter(lists))
K=dict(Counter(lists[-a:]))
import math
ans=1
sums=0
if J[max(lists)]<a:
    for some in K.keys():
        ans*=(math.factorial(J[some])//((math.factorial(K[some]))*math.factorial(J[some]-K[some])))
    print(ans)
elif J[max(lists)]>a:
    for i in range(a,min(b,J[max(lists)])+1):
        sums+=math.factorial(J[max(lists)])//(math.factorial(J[max(lists)]-i)*math.factorial(i))
    print(sums)
else:
    print(1)

from collections import Counter
from math import prod

N,A,B=map(int,input().split())
v=list(map(int,input().split()))

factorial=[1 for i in range(N+1)]
for i in range(1,N+1):
    if i==1:factorial[i]=1
    else:factorial[i] = factorial[i-1]*i

def comb(n,k):
    return factorial[n]*pow(factorial[n-k]*factorial[k], -1)
  
v = sorted(v,reverse=True)
  
if len(set(v[:A]))==1:
  print(v[0])
  ans=0
  for i in range(A,B+1):
    if i > 1 and v[i-1] != v[i-2]:break
    ans += comb(Counter(v)[v[0]],i)
  print(int(ans))
  return

print(sum(v[:A])/A)

c = Counter(v)
thr = v[A-1]

if c[thr] == 1 or v[A-1] != v[A]:
  res=[]
  for k in c.keys():
    if k >= thr:
      res.append(c[k])
    
  print(prod(res))
  return
  
res=[]
for k in c.keys():
  if k > thr:
    res.append(c[k])

ans=prod(res)

idx = v[:A].index(v[A-1])-1

print(int(ans*comb(c[v[A-1]],A-1-idx)))

import math

N,A,B = list(map(int,input().split()))
v = list(map(int,input().split()))

v.sort(reverse = True)
total = 0

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(A):
    total = total + v[i]
else:
    print((total / A))
    
count = 0
min = v[A-1]
number = v.count(min)

if(v.index(min) == 0):
    for i in range(A,number+1):
        if(i>B):
            break
        count = combinations_count(number,i) + count
    print(count)
else:
    print((combinations_count(number,A - v.index(min))))


f_memo = {0:1, 1:1}
def f(x):
  nonlocal f_memo
  if x in f_memo:
    return f_memo[x]
  else:
    res = x * f(x-1)
    f_memo[x] = res
    return res

comb_memo = {}
def comb(n, r):
  nonlocal comb_memo
  if (n, r) in comb_memo:
    return comb_memo[(n, r)]
  else:
    a = f(n)
    b = f(n-r)
    c = f(r)
    res = a // b // c
    comb_memo[(n, r)] = res
    return res


N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

mu = sum(v[:A]) / A
R = A-1
for i in range(A, N):
  if v[i] == mu:
    R = i
  else:
    break

R += 1
ans = 0
if R > A:
  for i in range(A, B+1):
    if i > R:
      break
    ans += comb(R, i)
else:
  min_v = v[A-1]
  n = v.count(min_v)
  need = v[:A].count(min_v)
  ans += comb(n, need)

print(mu)
print(ans)

from math import factorial
def comb(n,r):
  if n-r<0:
    return 0
  return factorial(n)//(factorial(r)*factorial(n-r))
n,a,b=map(int,input().split())
v=list(map(int,input().split()))
mod=10**9+7
v.sort(reverse=True)
x=v[a-1]
cnt=0
s=0
for i in range(n):
  if x==v[i]:
    cnt+=1
  if x<v[i]:
    s=i+1
ans=0
print(sum(v[:a])/a)
if v[0]==v[a-1]:
  for i in range(a,min(cnt+1,b+1)):
    ans+=comb(cnt,i)
  print(ans)
else:
  ans=comb(cnt,a-s)
  print(ans)

from math import factorial as f

def comb(n, r):
  return f(n) // (f(r) * f(n-r))

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

v.sort(reverse=True)

print((sum(v[:a])/a))

ans = 0
cnt0 = v.count(v[0])

if cnt0 >= a:
  for i in range(a, min(cnt0, b)+1):
    ans += comb(cnt0, i)
else:
  c = v[a-1]
  cnt1 = 0
  cnt2 = 0
  for i, vi in enumerate(v):
    if vi != c:
      continue
    if i < a:
      cnt1 += 1
    cnt2 += 1
  ans = comb(cnt2, cnt1)

print(ans)


from collections import Counter
from math import factorial

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))

V.sort(reverse=True)
c = Counter(V)

ans = []
L = []
for i in range(A, B + 1):

    ans.append(sum(V[0:i]) / i)
max_ans = max(ans)
print(('{:.6f}'.format(max_ans)))

num = 0
for j in range(B - A + 1):
    tmp = 1
    if ans[j] == max_ans:
        k = V[:A + j]
        cnt_k = Counter(k)
        for key, value in list(cnt_k.items()):
            tmp *= factorial(c[key]
                             ) // factorial(value) // factorial(c[key] - value)
        num += tmp

print(num)


nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)

"""
if len(set(v)) == 1:
    print(1)
    print(1125899906842623)
    return
"""

m = sum(v[:A])/A
print(m)

if len(set(v[:A]))==1:
    ans = 0
    c = v.count(v[0])
    for i in range(A,B+1):
        if i <= c:
            ans += cmb(c,i)
    print(ans)
    return

mi = min(v[:A])
n = v[:A].count(mi)
m = v.count(mi)
print(cmb(m,n))

N,A,B = [int(i) for i in input().split()]
v = [int(i) for i in input().split()]
v.sort()
v.reverse()
cum = [v[0]]

def comb(n, k):
    if k>n:
        return 0
    ans = 1
    for i in range(k):
        ans *= n-i
    for j in range(k):
        ans = ans//(j+1)
    return ans

for i in range(1,N):
    cum += [cum[i-1] + v[i]]
print(('{:.10f}'.format(cum[A-1]/A)))
target = v[A-1]
n = v.count(target)
fromk = (A-1) - v.index(target) + 1
if v[0] == target:
    ans = 0
    for i in range(A, min(B,n)+1):
        ans += comb(n, i)
    print(ans)
else:
    #print((n, fromk))
    ans = comb(n, fromk)
    print(ans)


n,a,b=map(int,input().split())
V=list(map(int,input().split()))
V.sort(reverse=True)
A=V[:a]
B=V[:b]
ave=sum(A)/a
print(ave)
C=[[0]*51 for _ in range(51)]
C[0][0]=1
for i in range(50):
    C[i+1][0]=1
    C[i+1][i+1]=1
    for j in range(i):
        C[i+1][j+1]=C[i][j]+C[i][j+1]
if A[0]==A[-1]:
    ans=0
    x=V.count(A[0])
    for i in range(a,b+1):
        if i<=x:
        	ans+=C[x][i]
else:
    x=V.count(A[-1])
    y=A.count(A[-1])
    ans=C[x][y]
print(ans)

import sys
input = sys.stdin.readline


def main():
    n, a, b = list(map(int, input().split()))
    v = list(map(int, input().split()))
    
    dp = [[0, 0] for _ in range(n+1)]
    dp[0][1] = 1
    for i in range(n):
        for j in range(n-1, -1, -1):
            if dp[j][1]:
                if dp[j+1][0] < dp[j][0]+v[i]:
                    dp[j+1][0] = dp[j][0]+v[i]
                    dp[j+1][1] = dp[j][1]
                elif dp[j+1][0] == dp[j][0]+v[i]:
                    dp[j+1][1] += dp[j][1]
    
    index, value, count = a, dp[a][0], dp[a][1]
    for i in range(a+1, b+1):
        if value*i == index*dp[i][0]:
            count += dp[i][1]
        elif value*i < index*dp[i][0]:
            value = dp[i][0]
            index = i
            count = dp[i][1]
                
    print((value/index))
    print(count)
    
def __starting_point():
    main()

__starting_point()

def comb(a,b):
    import math
    return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))

from itertools import accumulate
N,A,B = map(int,input().split())
v = list(map(int,input().split()))
v.sort(reverse=1)
va = v[:A]
maxa = sum(va)/A
maxsum = sum(va)
print(maxa)
count = 1
if va[0] == va[-1]:
    v0 = va[0]
    v0c = v.count(v0)
    ans = comb(v0c,A)
    for i in range(A,B):
        if v[i] == v0:
            ans += comb(v0c,i+1)
    print(ans)
else:
    v1 = va[-1]
    v1c = va.count(v1)
    v1c2 = v.count(v1)
    print(comb(v1c2,v1c))

import sys
readline = sys.stdin.readline

N,A,B = list(map(int,readline().split()))
V = list(map(int,readline().split()))

# 大きいほうからA個選んだときの平均値が求める平均値
# 大きいほうからA位の数字をPとすると、
# ・A位までの数字がすべてPのとき：Pの個数から、A～B個選ぶ場合の数
# ・そうでないとき：Pの個数から、A位までに必要なPの個数を選ぶ場合の数

V = sorted(V, reverse = True)

print((sum(V[:A]) / A))

from scipy.special import comb

P = V[A - 1]
pcnt = V.count(P)

if V[0] == P:
  ans = 0
  for i in range(A, B + 1):
    ans += comb(pcnt, i, exact = True)
  print(ans)
else:
  pneed = (V[:A]).count(P)
  print((comb(pcnt, pneed, exact = True)))


import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = 10**6#float('inf')
#mod = 10 ** 9 + 7 
mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

#階乗#
lim = 50
fact = [1] * (lim+1)
for n in range(1, lim+1):
	fact[n] = n * fact[n-1]

def C(n, r):
	return fact[n]//fact[n-r]//fact[r]


N, A, B = MAP()
v = sorted(LIST(), reverse=True)

V_cnt = Counter(v)
V_max = Counter(v[:A])
key = v[A-1]
print(sum(v[:A])/A)

v = v[::-1]

idx_1 = bisect_left(v, key)
idx_2 = bisect(v, key)
n = idx_2 - idx_1
k = bisect(v, key)
m = N - k


if m == 0:
	ans = 0
	for i in range(A, min(B-m, n)+1):
		ans += C(n, i)
	print(ans)
else:
	print(C(n, A-m))

def comb(n, r):
    if n < r:
        return 0

    ret = 1
    for i in range(1, r + 1):
        ret = ret * (n - i + 1) // i

    return ret


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

v.sort(reverse=True)
ave = sum(v[:a]) / a

if v[0] == v[a-1]:
    sm = v.count(v[0])
    cnt = 0
    for i in range(a, b + 1):
        cnt += comb(sm, i)

else:
    last = v[a-1]
    select = v[:a].count(last)
    sm = v.count(last)
    cnt = comb(sm, select)

print(ave)
print(cnt)


n,a,b =map(int, input().split())
al = list(map(int, input().split()))
newal = sorted(al,reverse = True)
ave = 0
ml = []
for i in range(a,b+1):
    avet = sum(newal[:i])/i
    if avet >= ave:
        ml.append(i)
        ave = max(ave,avet)
print(ave)

import collections
c = collections.Counter(al)

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

res = 0
for j in ml:
    r = c[newal[j-1]]
    rr = newal.index(newal[j-1])
    res += cmb(r,j-rr)
print(res)

from functools import lru_cache

@lru_cache
def comb(n, k):
    if k == 0:
        return 1
    elif n == k:
        return 1
    else:
        return comb(n-1, k) + comb(n-1, k-1)

N, A, B = map(int, input().split())
vs = sorted(map(int, input().split()), reverse = True)

print(sum(vs[:A]) / A)
v_replaceable = vs[A]

n = vs.count(v_replaceable)
a = A - vs.index(v_replaceable)
b = min(n, B - vs.index(v_replaceable))

if vs[0] == v_replaceable:
    #n個からa~b個を選ぶ選び方が答え。
    print(sum(comb(n, t) for t in range(a, b+1)))
else:
    #n個からa個を選ぶ選び方が答え。
    print(comb(n, a))

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

from decimal import Decimal as de
l=sorted(list(map(int,input().split())),reverse=1)
fact=[1]
for i in range(1,51):
    fact.append(fact[-1]*i)
from collections import Counter as co
if l[0]==l[a-1]:
    def comb(x,y):
        return fact[x]//(fact[y]*fact[x-y]) if x>=y>=0 else 0
    x=co(l)[l[0]]
    print(l[0])
    print(sum(comb(x,i)for i in range(a,b+1)));return
ave=de(str(sum(l[:a])))/a
print(ave)

y=co(l[:a])[l[a-1]]
x=co(l)[l[a-1]]
print(fact[x]//(fact[y]*fact[x-y]))

#!/usr/bin/env python3

from copy import deepcopy

def main():
    n, a, b = list(map(int, input().split()))
    v = list(map(int, input().split()))
    dp = [[0, 0] for i in range(n + 1)]
    dp[0] = [0, 1]
    for j in range(n):
        dppre = deepcopy(dp)
        for i in range(n):  # 配る
            vnew = dppre[i][0] + v[j]
            ways = dppre[i][1]
            if vnew > dp[i + 1][0]:
                dp[i + 1] = [vnew, ways]
            elif vnew == dp[i + 1][0]:
                dp[i + 1][1] += ways

    maxave = 0.0
    for i in range(a, b + 1):
        maxave = max(maxave, dp[i][0] / i)
    ways = 0
    for i in range(a, b + 1):
        if dp[i][0] / i == maxave:
            ways += dp[i][1]
    print(maxave)
    print(ways)

def __starting_point():
    main()

__starting_point()

N,A,B=map(int,input().split())
vlist=list(map(int,input().split()))
vlist.sort(reverse=True)

dp=[[0]*(N+1) for _ in range(N+1)]

for i in range(1,N+1):
  for j in range(1,N+1):
    dp[i][j]=dp[i-1][j]
    dp[i][j]=max(dp[i][j],dp[i-1][j-1]+vlist[i-1])

max_value_avg=0
for j in range(A,B+1):
  #print(j,dp[-1][j])
  value_avg=dp[-1][j]/j
  max_value_avg=max(max_value_avg,value_avg)
  
max_avg_size=[]
for j in range(A,B+1):
  value_avg=dp[-1][j]/j
  if value_avg==max_value_avg:
    max_avg_size.append(j)
#print(max_avg_size)    

def comb(n,r):
  r=min(r,n-r)
  nPr=1
  fact_r=1
  for i in range(r):
    nPr*=n-i
    fact_r*=r-i
  return nPr//fact_r

answer=0
for m in max_avg_size:
  border=vlist[m-1]
  n1=n2=n3=0
  for v in vlist:
    if v>border:
      n1+=1
    elif v==border:
      n2+=1
    else:
      n3+=1
  answer+=comb(n2,m-n1)

print(max_value_avg)
print(answer)

from collections import Counter

N, A, B = list(map(int, input().split()))
V = list(map(int, input().split()))
V.sort(reverse=True)

S = sum(V[:A])
cnt = A
mx = S / cnt
L = [cnt]

for v in V[A:]:
    if cnt == B:
        break
    cnt += 1
    S += v
    if mx < S / cnt:
        mx = S / cnt
        L = []
    if mx == S / cnt:
        L.append(cnt)

def ncr(n, r):
    ret = 1
    for i in range(r):
        ret *= (n - i)
    for i in range(1, r + 1):
        ret //= i
    return ret

print(mx)
ans = 0
cntV = Counter(V)
for c in L:
    cnt = Counter(V[:c])
    prd = 1
    for x, c in list(cnt.items()):
        prd *= ncr(cntV[x], c)
    ans += prd
print(ans)


# coding: utf-8
import sys
import numpy as np
from math import factorial

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, A, B = lr()
V = np.array(lr())
V.sort()
ave = V[-A:].sum() / A
print(ave)
border = V[-A]
left_i = np.searchsorted(V, border, side='left')
right_i = np.searchsorted(V, border, side='right')
seg = right_i - left_i  # 使える数字たち
done = N - right_i
use = A - done  # 使う幅

def combinations_count(n, r):  # 組み合わせ
    return factorial(n) // factorial(n - r) // factorial(r)

answer = combinations_count(seg, use)
if border == ave:
    for x in range(use+1, min(B-done, seg)+1):
        answer += combinations_count(seg, x)

print(answer)
# 05


INF = 10 ** 7
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  heapq import heappop,heapify,heappush

fac = [1,1]
for i in range(2,51):
    fac.append(fac[-1] * i)

def nck(n,k):
    return fac[n]//fac[n - k]//fac[k]

def main():
    n,a,b = list(map(int,input().split()))
    v = list(map(int,input().split()))

    v.sort(reverse=True)
    tot = sum(v[:a])
    cnt = a

    ok = 0
    change = 0
    for i in range(a,n):
        if v[i] * cnt == tot:
            ok += 1
        elif v[i] == v[a - 1]:
            change += 1
    
    same = 1
    for i in range(a - 2,-1,-1):
        if v[i] == v[a - 1]:
            same += 1
    
    ans = 0
    if ok > 0:
        for i in range(same,b - a + same + 1):
            ans += nck(same + ok,i)
    elif change > 0:
        ans += nck(same + change,same)
    else:
        ans += 1

    print((tot/cnt))
    print(ans)

def __starting_point():
    main()

__starting_point()

import math
from collections import Counter

N, A, B = map(int, input().split())
v = list(map(int, input().split()))

v.sort(reverse = True)
cnt_v = Counter(v)
ave = []

for i in range(A, B+1):
    ave.append(sum(v[0:i]) / i)

max_ave = max(ave)
ans = 0

for j in range(B-A+1):
    temp = 1
    if ave[j] == max_ave:
        l = v[:A+j]
        cnt_l = Counter(l)
        for key, values in cnt_l.items():
            temp *= (math.factorial(cnt_v[key]) // math.factorial(values) // math.factorial(cnt_v[key] - values))
        ans += temp

print(max_ave)
print(ans)

#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def comb(n: int, r: int):
    if r > n - r:
        return comb(n, n - r)
    p = q = 1
    for i in range(r):
        p *= n - i
        q *= i + 1
    return p // q


def solve(N: int, A: int, B: int, v: "List[int]"):
    v.sort(reverse=True)
    sl = v[:A]
    print((sum(sl) / A))
    if len(set(sl)) == 1:
        m = sl[0]
        cm = v.count(m)
        ans = 0
        for z in range(A, min(cm, B) + 1):
            ans += comb(cm, z)
        print(ans)
    else:
        m = sl[-1]
        cm = v.count(m)
        print((comb(cm, sl.count(m))))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    v = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B, v)


def __starting_point():
    main()

__starting_point()

N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())))[::-1]
W = sum(V[:A])/A
print(W)

f = [1]
for n in range(50):
  f+=[f[-1]*(n+1)]
x = V.count(V[A-1])
if V[0]==V[A-1]:
  print(sum(f[x]//(f[x-n]*f[n]) for n in range(A,B+1)))
else:
  y=V[:A].count(V[A-1])
  print(f[x]//(f[x-y]*f[y]))

from collections import Counter
from math import factorial
def comb(n, k):
    return factorial(n) // (factorial(k) * factorial(n-k))
n, a, b = list(map(int, input().split()))
v = list(map(int, input().split()))
v.sort(reverse=True)
cnt = Counter(v)
print((sum(v[:a]) / a))

if v[0] == v[a-1]:
    x = cnt[v[0]]
    ans = 0
    for i in range(a, min(x, b)+1):
        ans += comb(x, i)

    print(ans)

else:
    x = cnt[v[a-1]]
    for i in range(a):
        if v[i] == v[a-1]:
            y = i
            break

    print((comb(x, a-y)))


import math
n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
c = 0
def comb(N, R):
	if N < R:
		return 0
	return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))
if len(set(v[:a])) == 1:
	x = v[:a][0]
	d = 0
	for i in v:
		if i == x:
			d += 1
	for i in range(a,min(d+1,b+1)):
		c += comb(d,i)
	print (x)
	print (c)
else:
	x = v[:a][0]
	y = sorted(v[:a])
	av = sum(v[:a])/a
	z = y[0]
	d = 0
	for i in v:
		if i == z:
			d += 1
	e = 0
	for i in y:
		if i == z:
			e += 1
	c = comb(d,e)
	print (av)
	print (c)

from math import factorial
from collections import Counter

def cmb(n,r):
    return factorial(n)//(factorial(n-r)*factorial(r))

N,A,B=map(int,input().split())
v=list(map(int,input().split()))
v.sort(reverse=True)
l=Counter(v)

avg=0
cnt=0
for i in range(A,B+1):
    tmp=sum(v[:i])/i
    if tmp>avg:
        avg=tmp
        cnt=cmb(l[v[A-1]],v[:i].count(v[i-1]))
    elif tmp==avg:
        cnt+=cmb(l[v[A-1]],v[:i].count(v[i-1]))
print(avg)
print(cnt)

n, a, b = map(int, input().split())
V = list(map(int, input().split()))
V.sort(reverse=True)

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans = 0
x = 0
y = 0
for i in range(n):
    if i <= a-1:
        ans += V[i]
        if V[i] == V[a-1]:
            x += 1
            y += 1
    else:
        if V[i] == V[a-1]:
            x += 1

if V[0] != V[a-1]:
    cnt = combinations_count(x, y)
    print(ans/a)
    print(cnt)
else:
    cnt = 0
    for i in range(a, b+1):
        if i <= x:
            cnt += combinations_count(x, i)
    print(ans/a)
    print(cnt)

N, A,B,*V = map(int,open(0).read().split())
V = sorted(V)[::-1]
ans1 = sum(V[:A])/A
print(ans1)
f = [1] *51
for i in range(1,51):
  f[i] = f[i - 1] * i
def comb(n,r):
  return f[n]//f[r]//f[n-r]
ans2 = comb(V.count(V[A-1]),V[:A].count(V[A-1]))
if V[0] == V[A-1]:
  for i in range(A+1,B+1):
    ans2 += comb(V.count(V[A-1]),i)
print(ans2)

def ncr(n, r):
  if n < r:
    return 0
  res = 1
  for i in range(1, n + 1):
    res *= i
  for i in range(1, r + 1):
    res //= i
  for i in range(1, n - r + 1):
    res //= i
  return res
n, a, b = list(map(int, input().split()))
v = sorted(list(map(int, input().split())), reverse=True)
print((sum(v[0:a]) / a))
if v[0] == v[a - 1]:
  c = v.count(v[0])
  ans = 0
  for i in range(a, b + 1):
    ans += ncr(c, i)
  print(ans)
else:
  k = v.count(v[a - 1])
  r = v[0:a].count(v[a - 1])
  print((ncr(k, r)))


import itertools,collections
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def main():
    n,a,b=list(map(int, input().split()))
    v=[int(i) for i in input().split()]
    v.sort(reverse = True)
    tmp = v[0:a]
    dd = collections.defaultdict(int)

    for i in v:
        dd[i]+=1

    cnt = 0
  
    k = 0
    for i in tmp:
        k+=i
    s = min(tmp)
    avg = k/len(tmp)
    if(tmp[0]!=s):
        howmany = v.count(s)
        nantoori = tmp.count(s)
        #howmany個からnantoori個選ぶ方法
        res = howmany

        for i in range(nantoori-1):
            res *= (howmany-i+1)
        res2 = 1
        for i in range(nantoori):
            res2 *= (i+1)
        print(avg)
        print((combinations_count(howmany,nantoori)))
    else:
        howmany = dd[s]
        res=0
        for i in range(a,min(b+1,howmany+1)):
            res += combinations_count(howmany, i)


        print(avg)
        print(res)


def __starting_point():
    main()

__starting_point()

N,A,B=map(int,input().split())
vlist=list(map(int,input().split()))
#vlist.sort(reverse=True)

dp=[[(-1,-1)]*(N+1) for _ in range(N+1)]
dp[0][0]=(0,1)

for i in range(1,N+1):
  dp[i][0]=(0,1)
  for j in range(1,i+1):
    dp[i][j]=dp[i-1][j]
    if dp[i-1][j-1][0]+vlist[i-1]>dp[i][j][0]:
      dp[i][j]=(dp[i-1][j-1][0]+vlist[i-1],dp[i-1][j-1][1])
    elif dp[i-1][j-1][0]+vlist[i-1]==dp[i][j][0]:
      dp[i][j]=(dp[i][j][0],dp[i][j][1]+dp[i-1][j-1][1])
#print(dp)

max_value_avg=0
for j in range(A,B+1):
  #print(j,dp[N][j])
  value_avg=dp[N][j][0]/j
  max_value_avg=max(max_value_avg,value_avg)

answer=0
for j in range(A,B+1):
  value_avg=dp[N][j][0]/j
  if value_avg==max_value_avg:
    answer+=dp[N][j][1]
  
print(max_value_avg)
print(answer)

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N,A,B= (int(x) for x in input().split())
v = list(map(int, input().strip().split()))
v.sort(reverse=True)
print((sum(v[0:A])/A))
ctall = 0
ct = 0
for i in range (A):
    if v[i] == v[A-1]:
        ct += 1
answer = 0
for i in range (N):
    if v[i] == v[A-1]:
        ctall += 1
    if v[i] < v[A-1]:
        break
if (ct == A):
    for i in range(A,min(ctall+1,B+1)):
        answer += combinations_count(ctall, i)
    print(answer)
else: print((combinations_count(ctall, ct)))


N,A,B=list(map(int,input().split()))
l=list(map(int,input().split()))
l.sort(reverse=True)
all_n=l.count(l[0])
from scipy.special import comb
from collections import Counter
l2=l[0:A]
l_c=Counter(l)
max_mean=sum(l2)/A
l2=Counter(l2).items()
print(max_mean)
ans=1
if l[0]==l[A-1]:
   ans=0
   for i in range(A,B+1):
      ans+=comb(all_n,i,exact=True)
   print(ans)
   return
for i,j in l2:
   ans*=comb(l_c[i],j,exact=True)
print(ans)

from collections import Counter
import math
n,a,b = map(int,input().split())
v = sorted(list(map(int,input().split())))[::-1]
l = Counter(v)
su = 0
ko = 0

def C(a,b):
  return math.factorial(a)//(math.factorial(b)*math.factorial(a-b))
for i in range(a,b+1):
  v1 = v[:i]
  s = sum(v1)/i
  if su<s:
    su = s
    ko = C(l[v[a]],v1.count(v1[-1]))
  elif su==s:
    ko += C(l[v[a]],v1.count(v1[-1]))
 # print(s,ko)
print(su)
print(ko)

from scipy.special import comb
ans=0
N,A,B=map(int,input().split())
L=list(map(int,input().split()))
#Aこの平均でよい
L=sorted(L,reverse=True)
if len(set(L))==1:
  print(L[0])
  for i in range(A,B+1):
    ans+= comb(N, i, exact=True)
  print(ans)
  return
print(sum(L[:A])/A)
R=list(L[:A])
c=L[A-1]
if len(set(R))==1:
  n=L.count(c)
  for i in range(A,min(n,B)+1):
    ans+= comb(n, i, exact=True)
  print(ans)
  return
a=L.count(c)
b=R.count(c)
print(comb(a,b,exact=True))

import sys
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

v_list.sort(reverse=True)
max_mean = sum(v_list[:a])/a

number = v_list[a-1]

if v_list[:a].count(number) == a:
    count = 0
    for i in range(a,b+1):
        rest_list = v_list[i:]
        all_num = v_list.count(number)
        rest_num = rest_list.count(number)
        if rest_num > 0 or v_list[i-1] == number:
            count += comb(all_num,rest_num)
    print(max_mean)
    print(count)
else:
    rest_list = v_list[a:]
    all_num = v_list.count(number)
    rest_num = rest_list.count(number)
    print(max_mean)
    print(comb(all_num,rest_num))


N, A, B = list(map(int, input().split()))
v = list(map(int, input().split()))

v = sorted(v)[::-1]

v_ref = sum(v[:A])# / A

i = A
## n = 1
n_min = A
n_max = B
while (i<B):
    ## v_new = (i*v_ref + v[i]) / (i+1)
    v_new = v_ref + v[i]
    ## if v_new < v_ref:
    if i*v_new < (i+1)*v_ref:
        n_max = i
        break
    ## if v_new > v_ref:
    if i*v_new > (i+1)*v_ref:
        n_min = i+1
    v_ref = v_new
    i+=1

def comb(n, k):
    r = 1
    for x,y in zip(list(range(n,n-k,-1)), list(range(1,k+1))):
        r = r * x
        assert r % y == 0
        r = r // y
    return r

result = 0
for n in range(n_min, n_max+1):
    v_min = min(v[:n])
    num_min = sum([v_ == v_min for v_ in v])
    num_fixed = sum([v_ > v_min for v_ in v[:n]])
    num_selected = n - num_fixed
    result += comb(num_min, num_selected)

v_max_avg = sum(v[:n_min]) / n_min

print(f"{v_max_avg:.6f}")
print(result)