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 C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

//#define INF (1e10)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x) { cout << x << endl; }
template<class T, class... A> void print(const T& first, const A& ... rest) { cout << first << " "; prll(rest...); }
struct PreMain { PreMain() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } premain;

ull comb(int n, int r) {
	std::vector<std::vector<ull>> v(n + 1, std::vector<ull>(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v[n][r];
}

int main() {
	int N, A, B;
	cin >> N >> A >> B;	

	vector<ull> V(N);
	REP(i, N) cin >> V[i];
	sort(V.rbegin(), V.rend());

	double s = 0;
	REP(i, A) s += V[i];

	print(s / A);

	ull a = 0;
	ull b = 0;
	REP(i, A) {
		if (V[i] == V[A - 1]) {
			a++;
		}
	}
	REPN(i, A, N) {
		if (V[i] == V[A - 1]) {
			b++;
		}
	}

	if (a == A) {
		//すべて同じ値だったらB個使ってもいい
		ull ans = 0;
		REPN(j, A, min(static_cast<ull>(B), (a + b)) + 1) {
			ans += comb((a + b), j);
		}
		print(ans);
	}
	else {
		print(comb((a + b), a));
	}

	return 0;
}