output_description: 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.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N A B
      v_1
      v_2
      ...
      v_N
attempt: #include <bits/stdc++.h>
  using namespace std;
  typedef long long ll;
  const ll inf = 1e18;
  #define rep(i, a, b) for (int i = a; i < b; i++)
  #define per(i, a, b) for (int i = b - 1; i >= a; i--)
  #define int ll
  using pint = pair<int, int>;
  
  signed main() {
      int n, a, b;
      cin >> n >> a >> b;
      double v[n];
      map<double, int, greater<double>> mp;
      rep (i, 0, n) {
          cin >> v[i];
          mp[v[i]]++;
      }
      int cnt = 0;
      double sum = 0;
      ll ans = 1;
      double ave = 0;
      for (auto p : mp) {
          if (cnt + p.second < a) {
              sum += p.second * p.first;
              cnt += p.second;
          } else if (a <= cnt + p.second) {
              if (cnt == 0) {
                  ans=0;
                  rep(k,A,min(B,p.second)+1){
                      ll tmp=1;
                      rep (i, 1, p.second + 1) tmp *= i;
                      rep (i, 1, k + 1) tmp /= i;
                      rep (i, 1, p.second - k + 1) tmp /= i;
                      ans+=tmp;
                  }
                  ave = p.first;
  
              } else {
                  int cnt2 = a - cnt;
                  rep (i, 1, p.second + 1) ans *= i;
                  rep (i, 1, cnt2 + 1) ans /= i;
                  rep (i, 1, p.second - cnt2 + 1) ans /= i;
                  ave = (sum + cnt2 * p.first) / a;
              }
              break;
          }
      }
      cout << fixed << setprecision (15) << ave << "\n" << ans << "\n";
  }
  
problem_description: 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.
samples: [{"input": "5 2 2\n    1 2 3 4 5", "output": "4.500000\n    1\n    \n\nThe mean of the values of selected items will be maximized when selecting the\nfourth and fifth items. Hence, the first line of the output should contain\n4.5.  \nThere is no other way to select items so that the mean of the values will be\n4.5, and thus the second line of the output should contain 1.\n\n* * *"}, {"input": "4 2 3\n    10 20 10 10", "output": "15.000000\n    3\n    \n\nThere can be multiple ways to select items so that the mean of the values will\nbe maximized.\n\n* * *"}, {"input": "5 1 5\n    1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996", "output": "1000000000000000.000000\n    1"}]