Harryxun/stf_run huggingface dataset:
h, w = map(int,input().split())
pic = []

kabe_up_down = []
for i in range(w):
    kabe.append('.')

for i in range(h):
    onelist = ['.']
    inp = list(str(input()))
    for i in range(len(inp)):
        onelist.append(inp[i])
    onelist.append('.')
    pic.append(onelist)
    
flag = 1
a = 'a'
for i in range(1,h+1):
    for j in range(1,w+1):
        here = pic[i][j]
        if here =='#' and pic[i+1][j] == '#':
            pic[i][j] = a
            pic[i+1][j] = a
        elif here =='#' and pic[i][j+1] == '#':
            pic[i][j] = a
            pic[i][j+1] = a
            
for i in range(h+1):
    for j in range(w+1):
        if pic[i][j] == '#':
            flag = 0
            break
        
if flag == 0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

h, w = map(int,input().split())
pic = []

kabe_up_down = []
for i in range(w+2):
    kabe_up_down.append('.')
pic.append(kabe_up_down)

for i in range(h):
    onelist = ['.']
    inp = list(str(input()))
    for mm in range(len(inp)):
        onelist.append(inp[mm])
    onelist.append('.')
    pic.append(onelist)
    
pic.append(kabe_up_down)    


flag = 1
a = 'a'
for i in range(1,h+1):
    for j in range(1,w+1):
        here = pic[i][j]
        if here =='#' and pic[i+1][j] == '#':
            pic[i][j] = a
            pic[i+1][j] = a
        elif here =='#' and pic[i][j+1] == '#':
            pic[i][j] = a
            pic[i][j+1] = a
        elif here =='#' and pic[i-1][j] == '#':
            pic[i][j] = a
            pic[i-1][j] = a
        elif here =='#' and pic[i][j+1] == '#':
            pic[i][j] = a
            pic[i][j+1] = a    
            
for i in range(1,h+1):
    for j in range(1,w+1):
        here = pic[i][j]
        if here == '#' and pic[i+1][j] == 'a':
            pic[i][j] = a
            pic[i+1][j] = a
        elif here =='#' and pic[i][j+1] == 'a':
            pic[i][j] = a
            pic[i][j+1] = a
        elif here =='#' and pic[i-1][j] == 'a':
            pic[i][j] = a
            pic[i-1][j] = a
        elif here =='#' and pic[i][j+1] == 'a':
            pic[i][j] = a
            pic[i][j+1] = a    
        
for i in range(1,h+1):
    for j in range(1,w+1):
        here = pic[i][j]
        if here == a and pic[i+1][j] == '#':
            pic[i][j] = a
            pic[i+1][j] = a
        elif here =='a' and pic[i][j+1] == '#':
            pic[i][j] = a
            pic[i][j+1] = a
        elif here =='a' and pic[i-1][j] == '#':
            pic[i][j] = a
            pic[i-1][j] = a
        elif here =='a' and pic[i][j+1] == '#':
            pic[i][j] = a
            pic[i][j+1] = a            
            
for i in range(1,h+1):
    for j in range(1,w+1):
        if pic[i][j] == '#':
            flag = 0
            

if flag == 0:
    print('No')
else:
    print('Yes')
n = int(input())
sum1 = 0
while n>0:
  sum1 += n%10
  n= int(n/10)
if sum1%9 == 0:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
if n % 9 == 0:
  print('Yes')
else:
  print('No')
a, b = map(int, input().split())
print(max(a, b) - abs(a, b) // 2 if not (a + b) % 2 else "IMPOSSIBLE")

### FIXED CODE ###

a, b = map(int, input().split())
print(max(a, b) - abs(a - b) // 2 if not (a + b) % 2 else "IMPOSSIBLE")
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    MAXL = 101
    def vtop(x1,x2,y1,y2,h1):
        ans = h1 + abs(x1-x2) + abs(y1-y2)
        return ans if ans <= 10**9 else 10**9
 
    N = II()
    b = [[0] * MAXL for _ in range(MAXL)]
 
    
    # get info
    info =[]
    info0 = []
    for _ in range(N):
        x,y,h = LMIIS()
        if h == 0:
            info0.append((x,y,h))
        else:
            info.append((x,y,h))
    if len(info) + len(info0) < N:
        raise

    # init candidates
    x,y,h = info[0]
    for i in range(MAXL):
        for j in range(MAXL):
            b[i][j] = vtop(x,j,y,i,h)



    # check
    # for x,y,h in info0:
    #     for i in range(MAXL):
    #         for j in range(MAXL):
    #             if b[i][j] > vtop(x,j,y,i,h):
    #                 b[i][j] = 0
    for x,y,h in info:
        for i in range(MAXL):
            for j in range(MAXL):
                if b[i][j] != vtop(x,j,y,i,h):
                    b[i][j] = 0



    # answer
    ansl = []

    for i in range(MAXL):
        for j in range(MAXL):
            if b[i][j] > 0:
                ansl.append((j,i,b[i][j]))
    for x0,y0,h0 in ansl:
        f = True
        for x1,y1,h1 in info + info0:
            if h1 != max(h0-abs(x0-x1)-abs(y0-y1),0):
                f = False
                break
        if f:
            print(x0,y0,h0)
            return
    raise




if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())

    N = II()
    info = []
    for _ in range(N):
        xi, yi, hi = LMIIS()
        if hi != 0:
            xt, yt, ht = xi, yi, hi
        info.append((xi, yi, hi))

    for Cy in range(101):
        for Cx in range(101):
            H = ht + abs(xt - Cx) + abs(yt - Cy)
            found = True
            for xi, yi, hi in info:
                tmp_h = max(H - abs(Cy-yi) - abs(Cx-xi), 0)
                if tmp_h != hi:
                    found = False
                    break
            if found:
                print('{} {} {}'.format(Cx,Cy,H))
                return



if __name__ == '__main__':
    main()
# 定数
INF = float("inf")
MOD = int(1e9 + 7)

import math

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

N, K = map(int, input().split())

num_blue = K
num_red = N - K

for k in range(1, K + 1):
	comb_blue = comb(num_blue - 1, k - 1)
	comb_red = comb(num_red + 1, k)
	print((comb_blue * comb_red) % MOD)


### FIXED CODE ###

import math

N, K = map(int, input().split())

MOD = 10 ** 9 + 7

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

for k in range(1, K + 1):
	if N - K + 1 < k:
		print(0)
		continue
	print(comb(K - 1, k - 1) * comb(N - K + 1, k) % MOD)
string = input()
num = int(input())
if num == 0:
    print(string)
else:
    out=string[0]
    for i in [i for i in range(len(string))]:
        if i != 0:
            if i%num == 0:
                out=out+string[i]
    print(out)


### FIXED CODE ###

l = input().split()
if int(l[0])+int(l[1])==15:
    print('+')
elif int(l[0])*int(l[1]) ==15:
    print('*')
else:
    print('x')
n,k=map(int,input().split())
H=sorted([int(input()) for i in range(n)])
print(min([h[i+k-1]-h[i] for i in range(n-k+1)]))


### FIXED CODE ###

n,k=map(int,input().split())
h=sorted([int(input()) for i in range(n)])
print(min([h[i+k-1]-h[i] for i in range(n-k+1)]))
#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = list(map(int, input().split()))
del ans[0]
ans = set(ans)
for i in range(n-1):
    a = list(map(int, input().split()))
    del a[0]
    ans = ans & set(a)
print(len(ans))
"""


#C
"""
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
a = list(map(int, input().split()))
print(gcd_list(a))
"""

#D
n,m = map(int, input().split())
a = list(map(int, input().split()))
num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
ans = ["" for i in range(n + 1)]
num_ans = []
if 5 in a:
    if 3 in a:
        a.remove(3)
    if 2 in a:
        a.remove(2)
if 3 in a:
    if 2 in a:
        a.remove(2)
if 9 in a:
    if 6 in a:
        a.remove(6)
for i in a:
    num_ans.append(num[i])
for i,k in enumerate(num_ans):
    ans[k] = a[i] 
for i in range(n + 1):
    xmax = 0
    for y, b in enumerate(num_ans):
        if i - b >= 0:
            if ans[i-b] != "":
                x = str(a[y]) + str(ans[i - b])
                xmax = max(xmax, int(x))
    if xmax != 0:
        ans[i] = xmax
print(ans[n])

### FIXED CODE ###

#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = list(map(int, input().split()))
del ans[0]
ans = set(ans)
for i in range(n-1):
    a = list(map(int, input().split()))
    del a[0]
    ans = ans & set(a)
print(len(ans))
"""


#C
"""
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
a = list(map(int, input().split()))
print(gcd_list(a))
"""

#D
n,m = map(int, input().split())
a = list(map(int, input().split()))
num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
ans = [-float("inf") for _ in range(n + 1)]
num_ans = []
a.sort(reverse=True)
for i in a:
    num_ans.append(num[i])
ans[0] = 0
for i in range(n + 1):
    for b in num_ans:
        if i - b >= 0:
            ans[i] = max(ans[i - b] + 1, ans[i])
anse = ""
while ans[n] > 0:
    for k, i in enumerate(num_ans):
        if n - i >= 0:
            
            if ans[n] - 1 == ans[n - i]:
                anse += str(a[k])
                n -= i
                break
    if n < 0:
        break
            
print(anse)
from bisect import bisect_left
def main():
  s=input()
  t=input()
  n=len(t)
  m=len(s)
  lindex=[[] for _ in range(26)]
  for i in range(m):
    if s[i] in t:
      lindex[ord(s[i])-97].append(i)
  for i in range(n):
    if len(lindex[ord(t[i])-97])==0:
      print(-1)
      exit()
  cnt=0
  for i in range(n-1):
    if l==bisect_left(lindex[ord(t[i+1])-97],lindex[ord(t[i])-97][0]):
      cnt+=1
  k=lindex[ord(t[n-1])-97][0]
  return print(m*cnt+k+1)
if __name__=='__main__':
  main()

### FIXED CODE ###

from bisect import bisect_right
def main():
  s=input()
  t=input()
  n=len(t)
  m=len(s)
  lindex=[[] for _ in range(26)]
  for i in range(m):
    if s[i] in t:
      lindex[ord(s[i])-97].append(i)
  for i in range(n):
    if len(lindex[ord(t[i])-97])==0:
      print(-1)
      exit()
  cnt=0
  inde=-1
  for i in range(n):
    l=len(lindex[ord(t[i])-97])
    idx=bisect_right(lindex[ord(t[i])-97],inde)
    if l==idx:
      cnt+=1
      inde=lindex[ord(t[i])-97][0]
    else:
      inde=lindex[ord(t[i])-97][idx]
  return print(m*cnt+inde+1)
if __name__=='__main__':
  main()
a,b = map(int,input().split())

c = a*100 + b
d = 0
while d**2 < c:
  d = d + 1
  if d**2 ==c:
    print(Yes)
    exit()
print(No)
  

### FIXED CODE ###

a, b = input().split()
n = int(a+b)
if n == int(n**(1/2))**2:
  print('Yes')
else:
  print('No')
import sys
import numpy as np
import string

N = int(input())
S = [input() for i in range(N)]

dict = string.ascii_lowercase#abc...xyz

data_list = np.zeros((N,26))

for i in range(0,N):
	list = []
	for j in range(0,26):
		list.append(S[i].count(str(dict[j])))
	data_list[i] = np.array(list)
data_min = data_list.min(axis = 0)

del list
gc.collect()

a = np.nonzero(data_min)
size = np.nonzero(data_min)[0].size
b = a[0]
kotae = ""
for i in range(size):
	Moji = dict[b[i]]*int(data_min[b[i]])
	kotae = kotae + Moji
	pass
del data_min
gc.collect()

print(kotae)



### FIXED CODE ###

import sys
import numpy as np
import string

N = int(input())
S = [input() for i in range(N)]

dict = string.ascii_lowercase#abc...xyz

data_list = np.zeros((N,26))

for i in range(0,N):
	list = []
	for j in range(0,26):
		list.append(S[i].count(str(dict[j])))
	data_list[i] = np.array(list)
data_min = data_list.min(axis = 0)

a = np.nonzero(data_min)
size = np.nonzero(data_min)[0].size
b = a[0]
kotae = ""
for i in range(size):
	Moji = dict[b[i]]*int(data_min[b[i]])
	kotae = kotae + Moji
	pass
print(kotae)
X=input()

S=0

for i in range(L):
    if X[-(1+i)]=="S":
        S+=1
    else:
        break
print(2*S)



### FIXED CODE ###

A2=list(input())
A1=[]
L=len(A2)
A1.append(A2[0])

for i in range(1,L):
    if len(A1)>=1 and A1[-1]=="S" and A2[i]=="T":
        A1.pop(-1)
    else:
        A1.append(A2[i])

print(len(A1))
import sys
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
prog=0
a_idx=0
b_idx=0

while a_idx<n:
    if a[a_idx]+prog>k:
        break
    prog+=a[a_idx]
    a_idx+=1

if a_idx==n:
    while b_idx<m:
        if b[b_idx]+prog>k:
            break
        prog+=b[b_idx]
        b_idx+=1

mx=a_idx+b_idx

if mx==n+m:
    print(mx)
    sys.exit()

for i in range(a_idx):
    while b[b_idx]+prog<=k and b_idx<m:
        prog+=b[b_idx]
        b_idx+=1
    if a_idx+b_idx>mx:
        mx=a_idx+b_idx
    if b_idx==m:
        break
    a_idx-=1
    prog-=a[a_idx]

print(mx)

### FIXED CODE ###

import sys
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
prog=0
a_idx=0
b_idx=0

while a_idx<n:
    if a[a_idx]+prog>k:
        break
    prog+=a[a_idx]
    a_idx+=1

if a_idx==n:
    while b_idx<m:
        if b[b_idx]+prog>k:
            break
        prog+=b[b_idx]
        b_idx+=1

mx=a_idx+b_idx

if mx==n+m:
    print(mx)
    sys.exit()

for i in range(a_idx+1):
    while b_idx<m and b[b_idx]+prog<=k:
        prog+=b[b_idx]
        b_idx+=1
    if a_idx+b_idx>mx:
        mx=a_idx+b_idx
    if b_idx==m:
        break
    if a_idx==0:
        break
    a_idx-=1
    prog-=a[a_idx]

print(mx)
import sys,queue,math,copy,itertools
from fractions import gcd
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())

ans = len(S)
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans = min(ans,max(i+1,len(S)-i-1))

print (ans)



### FIXED CODE ###

import sys,queue,math,copy,itertools
from fractions import gcd
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())

S = input()
ans = len(S)
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans = min(ans,max(i+1,len(S)-i-1))

print (ans)
n=int(input())
b=list(map(int,input().split()))
c=0
d=0
while c<=n-3 :
    if (b[c+1]>b[c] and b[c+1]<b[c+2]) or (b[c+1]<b[c] and b[c+1]>b[c+2]):
        d +=1
        c +=1
    else:
        c+=1

print(d)


### FIXED CODE ###

S = input()
A = set (S)
B = len (A)
if B == 2:
    print ('Yes')
else:
    print ('No')
N,  K= map(int, input().split())
A = list(map(int, input().split()))
 
for i in range(0,N-K):
    if  A[i]<A[i+K]:
        print('Yes')
    else:
        print('No')  

### FIXED CODE ###

X= int(input())
if 399<X and X<600:
    print(8)
if 599<X and X<800:
    print(7)
if 799<X and X<1000:
    print(6)
if 999<X and X<1200:
    print(5)
if 1199<X and X<1400:
    print(4)
if 1399<X and X<1600:
    print(3)
if 1599<X and X<1800:
    print(2)
if 1799<X and X<2000:
    print(1)
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=(a.index(1)+k-2)//(k-1)
if (a.index(1))%(k-1)!=0:
  x+=1
  y=(n-a.index(1)-1+(a.index(1)+k-2)%(k-1))//(k-1)
else:
  y=(n-a.index(1)-1+k-2)//(k-1)
x2=(n-a.index(1)-1+k-2)//(k-1)
if (n-a.index(1)-1)%(k-1)!=0:
  x2+=1
  y2=(a.index(1)+(n-a.index(1)-1)%(k-1))//(k-1)
print(min(x+y,x2+y2))

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
if a.index(1)<k-1:
  print((n-2)//(k-1) +1)
  exit()
else:
  print((n-2)//(k-1) +1)
  exit()
print((a.index(1)+k-2)//(k-1) + (n-a.index(1)-1+k-2)//(k-1))
#codibg:utf-8
n = input()
h = input()
w = input()

print((n-h+1)*(n-w+1))

### FIXED CODE ###

#coding:utf-8
n = input()
h = input()
w = input()

print((int(n)-int(h)+1)*(int(n)-int(w)+1))
a = int(input())
b = int(input())
c = int(input())
s = {a, b, c}
print len(s)

### FIXED CODE ###

j = (input())

x = j.split()
y = []

for i in x:
  if(i not in y):
    y.append(i)
print(len(y))
print(input()*input())

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
N, M = map(int, input().split())
ps = [input().split() for i in range(M)]

ac = 0
wa = []
ansed = []
for psn in ps:
    if psn[1] == 'AC':
        if psn[0] not in ansed:
            ac += 1
            ansed.append(psn[0])
    else:
        if psn[0] not in ansed:
            wa[int(psn[0])-1] += 1
for i in range(N):
    if str(i+1) not in ansed:
        wa[i] = 0

print(ac, sum(wa))

### FIXED CODE ###

N, M = map(int, input().split())
ps = [input().split() for i in range(M)]

ac = 0
wa = [0 for i in range(N)]
ansed = set()
for psn in ps:
    if psn[1] == 'AC':
        if psn[0] not in ansed:
            ac += 1
            ansed.add(psn[0])
    else:
        if psn[0] not in ansed:
            wa[int(psn[0])-1] += 1
for i in range(N):
    if str(i+1) not in ansed:
        wa[i] = 0

print(ac, sum(wa))
k,s=int(input())
count = 0
for x in range(k+1):
  for y in range(k+1):
    if 0 <= (s - x - y) and (s - x - y) <= k:
      count += 1
print(count)

### FIXED CODE ###

k,s=map(int, input().split())
count = 0
for x in range(k+1):
  for y in range(k+1):
    if 0 <= (s - x - y) and (s - x - y) <= k:
      count += 1
print(count)
import bisect


n, k = map(int, input().split())
xs = list(map(int, input().split()))
index = bisect.bisect_right(xs, -1)

a = xs[:index][::-1]
cost = 0
if xs[index] == 0:
    cost += 1
    b = xs[index + 1:]
else:
    b = xs[index:]

cost_a = [0]
cost_b = [0]
for c in a:
    cost_a.append(abs(c))
for c in b:
    cost_b.append(c)

ret = float('inf')
if len(a) >= k - cost:
    ret = min(ret, cost_a[k - cost])
if len(b) >= k - cost:
    ret = min(ret, cost_b[k - cost])

for i in range(len(cost_a)):
    if k - i < len(cost_b):
        ret = min(ret, 2 * cost_a[i] + cost_b[k - i])

for i in range(len(cost_b)):
    if k - i < len(cost_a):
        ret = min(ret, 2 * cost_b[i] + cost_a[k - i])
print(ret)


### FIXED CODE ###

import bisect


n, k = map(int, input().split())
xs = list(map(int, input().split()))
index = bisect.bisect_right(xs, -1)

a = xs[:index][::-1]
cost = 0
if index < len(xs) and xs[index] == 0:
    cost += 1
    b = xs[index + 1:]
else:
    b = xs[index:]

cost_a = [0]
cost_b = [0]
for c in a:
    cost_a.append(abs(c))
for c in b:
    cost_b.append(c)

ret = float('inf')
if len(a) >= k - cost:
    ret = min(ret, cost_a[k - cost])
if len(b) >= k - cost:
    ret = min(ret, cost_b[k - cost])

for i in range(len(cost_a)):
    if 0 <= k - i < len(cost_b):
        ret = min(ret, 2 * cost_a[i] + cost_b[k - i])

for i in range(len(cost_b)):
    if 0 <= k - i < len(cost_a):
        ret = min(ret, 2 * cost_b[i] + cost_a[k - i])
print(ret)
N,Y = map(int, input().split())
for i in range(N):
    for l in range(N):
            ans = 10000*i + 5000*l + 1000*(N - i - l)
            if ans == Y:
                print("{} {} {} ".format(i ,l  ,(N - i - l)))
                exit()

print("-1 -1 -1")

### FIXED CODE ###

s = str(input())
l = s.replace("2017", "2018")
print(l)
K=int(input())
S=input()

def printt(S,K):
  if len(S)<=K:
    print(S)
  else:
    print(S[:k],'...')
      
printt(S,K)


### FIXED CODE ###

N=int(input())

def ass(N):
  if N%10 in [2,4,5,7,9]:
    print('hon')
  elif N%10 in [0,1,6,8]:
    print('pon')
  else:
    print('bon')
   
ass(N)
def ABC057D():

    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    v = sorted(v)[::-1]

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

        anslist.append([sum(v[0:i]) / i, i, v[i - 1]])
    anslist.sort()
    anslist = anslist[::-1]
    ans = anslist[0][0]
    key = anslist[0][2]
    long = anslist[0][1]
    print(ans)
    for i in range(1, len(anslist)):
        if anslist[i][0] == anslist[i - 1][0]:
            ans = anslist[i][0]
            key = anslist[i][2]
            long = anslist[i][1]
        else:
            break
    #print(anslist)
    #print(ans, key, long)
    cnt = 0
    for i in v:
        if i == key:
            cnt += 1

    c = 0
    for i in v[:long]:
        #print(i)
        if i == key:
            c += 1
    #print(c, long)
    ans = 0
    if c == long:
        for i in range(A,  min(B + 1, cnt + 1)):
            ans += cc(cnt, i)
    else:
        ans = cc(cnt, c)
    #print(anslist)
    #print(cnt, c, long)
    print(ans)
ABC057D()


### FIXED CODE ###

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


def ABC057D():

    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    v = sorted(v)[::-1]

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

        anslist.append([sum(v[0:i]) / i, i, v[i - 1]])
    anslist.sort()
    anslist = anslist[::-1]
    ans = anslist[0][0]
    key = anslist[0][2]
    long = anslist[0][1]
    print(ans)
    for i in range(1, len(anslist)):
        if anslist[i][0] == anslist[i - 1][0]:
            ans = anslist[i][0]
            key = anslist[i][2]
            long = anslist[i][1]
        else:
            break
    #print(anslist)
    #print(ans, key, long)
    cnt = 0
    for i in v:
        if i == key:
            cnt += 1

    c = 0
    for i in v[:long]:
        #print(i)
        if i == key:
            c += 1
    #print(c, long)
    ans = 0
    if c == long:
        for i in range(A,  min(B + 1, cnt + 1)):
            ans += cc(cnt, i)
    else:
        ans = cc(cnt, c)
    #print(anslist)
    #print(cnt, c, long)
    print(ans)
ABC057D()
def solve(n, m, a, b):
    res = []
    for i in range(n):
        s = [a[i][j] * b[j] for j in range(m)]
        res.append(sum(s))
    return res

if __name__ == '__main__':
    n, m = map(int, raw_input().split())
    a = [map(int, raw_input().split()) for _ in range(n)]
    b = [int(i) for i in input()) for _ in range(m)]
    for x in solve(n, m, a, b):
print(x)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]

matrix = []
for ni in range(n):
    matrix.append([int(a) for a in input().split()])

vector = []
for mi in range(m):
    vector.append(int(input()))

for ni in range(n):
    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]

    print(sum)
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

for i in n:
  x -= (i+1) * m[(i+1)]

print(x % min(m))


### FIXED CODE ###

n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

x -= sum(m)

print(n + x // min(m))
import math
import fractions

#最小公倍数
def union_lcm(lists):
    if len(lists)==1:
        return lists[0]
    elif len(lists)>1:
        num=lists[0]
        for i in range(1,len(lists)):
            num=num*lists[i]//fraction.gcd(num,lists[i])
        return num


#最大公約数
def union_gcd(lists):
    if len(lists)==1:
        return lists[0]
    elif len(lists)>1:
        num=lists[0]
        for i in range(1,len(lists)):
            num=fraction.gcd(num,lists[i])
        return num
    
n,m=map(int,input().split())
lists=list(map(int,input().split()))

#受け取ったリスト内の要素を2で割る(uselistっていうlistに保管)
uselist=[0 for i in range(n)]
for i in range(n):
    uselist[i]=lists[i]//2
  
G=union_lcm(uselist)
flag=True
for some in uselist:
    if (G//some)%2==0:
        flag=False
        break
if flag:
    if (m//G)%2==0:
        print((m//G)//2)
    else:
        print((m//G+1)//2)
    
else:
    print(0)


### FIXED CODE ###

n,m=map(int,input().split())
lists=list(map(int,input().split()))
uselist=[]
for some in lists:
    some=some//2
    uselist.append(some)

import fractions
import math
ans = uselist[0]
for i in range(1, n):
    ans = ans* uselist[i] // fractions.gcd(ans, uselist[i])

flags=True
for some in uselist:
    a=ans//some
    if a%2==0:
        flags=False
        break
if flags:
    p=math.floor(m/ans)
    if p%2==0:
      print(p//2)
    elif p%2!=0:
      print(p//2+1)
    
else:
    print(0)