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: Wrong Answer)

#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <algorithm>
#include <bitset>
#include <deque>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
//#include <unordered_map>
//#include <unordered_set>
using namespace std;


#define debug       cout << "***********************" << endl
#define Bug(s)      cout << "s = " << s << endl
#define mem(a,b)    memset(a, b, sizeof(a))
#define lson        l, mid, rt<<1
#define rson        mid + 1, r, rt<<1|1
#define For(i, x, n)  for(int i = (x) ; i < (n) ; ++i)
#define Forr(i, x, n) for(int i = (x) ; i <= (n) ; ++i)
#define Rep(i, x, n)  for(int i = (x) ; i > (n) ; --i)
#define Repp(i, x, n) for(int i = (x) ; i >= (n) ; --i)
#define highint( n )  ceil( n )
#define lowint( n )   floor( n )
#define SERU(x)       floor((double) x + 0.5 )
#define lowbit(x)     (x & (-x))

#define all(x)      (x).begin(), (x).end()
#define SZ(x)       (int)(x).size()
#define FA(i, a, x) for (__typeof((x).begin()) i=(a); i!=(x).end(); ++i)
#define RA(i, x)    FA(i, (x).begin(), x)
#define FDA(i, a, x)  for (__typeof((x).rbegin()) i=(x).rbegin(); i!=(a); ++i)
#define RDA(i, x)   FDA(i, (x).rend(), x)
#define P(v, x)     (v.find(x) != v.end())
#define Pos(v, x)   (find(all(v), x) != v.end())
#define UN(a)       sort(all(a)), a.erase(unique(all(a)), a.end())
#define REV(a)      reverse(all(a))
#define mp(a, b)    make_pair(a, b)
#define p(a, b)     pair<int, int>(a, b)
#define sf1i(x)     scanf("%d", &x)
#define sf1l(x)     scanf("%I64d", &x)
#define sf2i(x, y)  scanf("%d%d", &x, &y)
#define sf2l(x, y)  scanf("%I64d%I64d", &x, &y)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ll long long
#define eps 1e-8


//bool vis[60];
ll v[60];
//ll ans;
int n, a, b;
//bool go(int x){
//    return (x >= a && x <= b);
//}
//void dfs(int num, ll sum){
//    if(sum > ans || num > b)return;
//    if(sum == ans && go(num)){res++; return;}
//    For(i,0,n){
//        if(!vis[i]){
//            vis[i] = 1;
//            dfs(num + 1, sum + v[i]);
//            vis[i] = 0;
//        }
//    }
//}
int main(){
        ios_base::sync_with_stdio(0);///g++输入加速
        #ifdef cc
        int __size__ = 256 << 20; // 256MB  G++
        char *__p__ = (char*)malloc(__size__) + __size__;
        __asm__("movl %0, %%esp\n" :: "r"(__p__));
        #endif // cc
        #ifdef  freopenin
            freopen("in","r",stdin);
        #endif // freopenin

        #ifdef freopenout
            freopen("out.txt","r",stdout);
        #endif // freopenout
        string s;
//        memset(vis, 0, sizeof(vis));
//        memset(v, 0, sizeof(v));
        cin >> n >> a >> b;
        map<ll, int>mp;
        For(i,0,n){
            cin >> v[i];
            mp[v[i]]++;
        }
        sort(v, v + n);
        reverse(v, v + n);
        double ans1 = 0.;
        int res1 = 1, res2 = 1;
        int t = a;
        for(int i = 0; i < n; ){
            if(t <= 0)break;
            ans1 = ans1 + double(v[i]);
            t -= mp[v[i]];
            res1 *= mp[v[i]];
            i += mp[v[i]];
        }
        t = b;
        double ans2 = 0.;
        for(int i = 0; i < n; ){
            if(t <= 0)break;
            ans2 = ans2 + double(v[i]);
            t -= mp[v[i]];
            res2 *= mp[v[i]];
            i += mp[v[i]];
        }
        double ans;
        int res;
        if(ans1 / a > ans2 / b){
            res = res1;
            ans = ans1;
        }
        else{
            res = res2;
            ans = ans2;
        }
        printf("%.6lf\n%d\n", ans / (ll)a, res);
        return 0;
}