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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, A, B;
        public long[] V;
        public long MOD = 1000000007;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                N = line[0];
                A = line[1];
                B = line[2];
            }
            V = Input.ReadLongArray();
            Array.Sort(V);
            Array.Reverse(V);

            var comb = new PascalCombination(100);
            comb.Run();
            
            long val = V[A - 1];
            int up = 0;
            int same = 0;

            for (int i = 0; i < N; i++)
            {
                if (V[i] > val) up++;
                if (V[i] == val) same++;
            }

            {
                long retc = 0;
                int mn = A - up;
                int mx;
                if (up == 0)
                {
                    mx = Math.Min(same, B - up);
                }
                else
                {
                    mx = mn;
                }
                    
                for (int j = mn; j <= mx ; j++)
                {
                    Console.Error.WriteLine($"{same} {j}");
                    retc += comb.Combination(same, j);
                }

                double avg = V.Take(A).Sum() * 1.0 / A;
                Console.WriteLine(avg);
                Console.WriteLine(retc);
            }
        }
    }

    // libs ----------
    // パスカルの三角形、Nが小さくmodをとらない場合
    class PascalCombination
    {
        public long N;
        public long[,] Comb;

        public PascalCombination(int N)
        {
            this.N = N;
            Comb = new long[N + 1, N + 1];
        }

        public void Run()
        {
            // i == 0のケース
            Comb[0, 0] = 1;

            // i => 1のケース
            for (int i = 1; i <= N; i++)
            {
                for (int j = 0; j <= N; j++)
                    if (j == 0)
                    {
                        Comb[i, j] = 1;
                    }
                    else
                    {
                        Comb[i, j] = Comb[i - 1, j - 1] + Comb[i - 1, j];
                    }
            }
        }

        public long Combination(int n, int k)
        {
            if (k < 0 || k > n) return 0;
            return Comb[n, k];
        }

    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}