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: Runtime Error)

#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr = ds.begin(); itr != ds.end(); ++itr)
#define mp make_pair
#define INF 2000000000
#define INFL 2000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;

ll combi(ll n, ll r) {
	int i;
	ll p = 1;
	for (i = 1; i <= r; i++)
		p = p*(n - i + 1) / i;
	return p;
}

int main(void) {
	int N, A, B;
	cin >> N >> A >> B;
	vll v(N);
	bool same = true;
	rep(i, N) {
		cin >> v[i];
		if (same && v[i] != v[0]) {
			same = false;
		}
	}
	if (same) {
		ll ans = 0;
		repl(i, A, B + 1) {
			ans += combi(N, i);
		}
		vi dummy(INFL);
		cout << fixed << setprecision(14) << (double)v[0] << endl;
		cout << ans << endl;
		return 0;
	}
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());

	int idx = 0;
	ll sum = 0;
	while (idx < N) {
		int rest = A - idx;
		ll num = v[idx];
		int cnt = 0;
		while (idx < N && v[idx] == num) {
			cnt++;
			idx++;
		}
		if (idx < A) {
			sum += num*cnt;
		}
		else {
			sum += num*rest;
			cout << fixed << setprecision(14) << (double)sum / A << endl;
			cout << combi(cnt, rest) << endl;
			return 0;
		}
	}

	return 0;
}