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 Python (3.4.3) (judge verdict: Wrong Answer)

# -*- coding: utf-8 -*-

import sys
import os
import math


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

# 上からA個
subset = values[-A:]
mean = sum(subset) / len(subset)
print(mean)

# bug in big number
def combination(n, m):
    # n C m
    answer = n
    for i in range(m-1):
        answer *= (n - 1 - i)
    for i in range(1, m + 1):
        answer /= i
    return int(answer)


def pascals_triangle(n_rows):
    results = [] # a container to collect the rows
    for _ in range(n_rows):
        row = [1] # a starter 1 in the row
        if results: # then we're in the second row or beyond
            last_row = results[-1] # reference the previous row
            # this is the complicated part, it relies on the fact that zip
            # stops at the shortest iterable, so for the second row, we have
            # nothing in this list comprension, but the third row sums 1 and 1
            # and the fourth row sums in pairs. It's a sliding window.
            row.extend([sum(pair) for pair in zip(last_row, last_row[1:])])
            # finally append the final 1 to the outside
            row.append(1)
        results.append(row) # add the row to the results.
    return results[-1] # 最後だけでOK


# bug in big number
def combination2(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))


if subset[0] == subset[-1]:
    # 数を増やしてもmeanが減らない可能性がある
    cnt = values.count(subset[0])
    tri = pascals_triangle(cnt + 1)
    print('A', A, 'B', B)
    if cnt >= B:
        tri_subset = tri[A:B+1]
        print(sum(tri_subset))
    else:
        tri_subset = tri[A:cnt + 1]
        print(sum(tri_subset))


    """
    all = 0
    if cnt >= B:
        for i in range(A, B + 1):
            all += combination(cnt, i)
    else:
        for i in range(A, cnt + 1):
            all += combination(cnt, i)
    print(all)
    """
else:
    # 数を増やすのはあり得ない
    v = subset[0]
    cnt_in_all = values.count(v)
    cnt_in_subset = subset.count(v)
    ans = combination(cnt_in_all, cnt_in_subset)
    print(ans)