Problem:
Score : 400 points

Problem Statement

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 1

5 2 2
1 2 3 4 5

Sample Output 1

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.

Sample Input 2

4 2 3
10 20 10 10

Sample Output 2

15.000000
3

There can be multiple ways to select items so that the mean of the values will be maximized.

Sample Input 3

5 1 5
1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996

Sample Output 3

1000000000000000.000000
1

Solution in Pascal (FPC 2.6.2) (judge verdict: Accepted)

var n,i,j,a,b,tot1,tot2,left:longint;
    v:array[0..57] of int64;
	ans:real;
	sum,anss:int64;
procedure qsort(lx,rx:longint);
var i,j:longint;
    m,t:int64;
begin
  i:=lx;j:=rx;m:=v[random(rx-lx+1)+lx];
  repeat
    while (v[i]>m) do inc(i);
	while (v[j]<m) do dec(j);
	if (i<=j) then
	begin
	  t:=v[i];v[i]:=v[j];v[j]:=t;
	  inc(i);dec(j);
	end;
  until (i>j);
  if (i<rx) then qsort(i,rx);
  if (j>lx) then qsort(lx,j);
end;
function gcd(a,b:longint):longint;
begin
  if (b=0) then exit(a);
  exit(gcd(b,a mod b));
end;
function calc(i,j:longint):int64;
var ans:int64;
  t:array[0..100] of longint;
  ii,jj,tt,g:longint;
begin
  for ii:=1 to j do
	t[ii]:=i-j+ii;
  for ii:=1 to j do
  begin
    tt:=ii;
    for jj:=1 to j do
	begin
	  g:=gcd(t[jj],tt);
	  tt:=tt div g;
	  t[jj]:=t[jj] div g;
	end;
  end;
  ans:=1;
  for ii:=1 to j do
	ans:=int64(ans*t[ii]);
  exit(ans);
end;
begin
  randomize;
  readln(n,a,b);
  for i:=1 to n do
	read(v[i]);
  qsort(1,n);
  sum:=0;
  for i:=1 to a do
	sum:=sum+v[i];
  ans:=sum/a;
  writeln(ans:0:6);
  tot1:=0;tot2:=0;
  for i:=1 to n do
	if (v[i]=v[a]) then inc(tot1);
  left:=1;
  while (left<=n) and (v[left]<>v[a]) do inc(left);
  dec(left);
  a:=a-left;b:=b-left;
  anss:=0;
if (left=0) then
begin
  for i:=a to b do
    anss:=anss+calc(tot1,i);
end else anss:=calc(tot1,a);
  writeln(anss);
end.