Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using long long = ll;
#define rep(i, n) for (int i=0; i<(int)(n); i++)

ll comb(ll n, ll r){
  ll x = 1, y= 1;
  rep(i,r){
    x *= n - i;
    y *= r - i;
  }
  cout << x/y;
}

int main(){
  double N, A, B;
  cin >> N >> A >> B;
  vector<ll> v(N);
  rep(i,N){
    cin >> v.at(i);
  }
  sort(v.begin(), v.end(), greater<long long>());
  ll sum = 0;
  rep(i,A){
    sum += v.at(i);
  }
  ll num = 0;
  ll chosen = 0;
  bool all_equal = true;
  rep(i,N){
    if(v.at(i)==v.at(A-1)){
      num++;
      if(i<A) chosen++;
    }
    if(v.at(i)!=v.at(0)) all_equal = false;
  }
  ll mtd = 0;
  if(all_equal){
    for(int i=A; i<=B; i++){
      mtd += comb(num,i);
    }
  }else{
    mtd += comb(num,chosen);
  }
  cout << sum/A << endl;
  cout << mtd;
  return 0;
}

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'long'
    5 | using long long = ll;
      |       ^~~~
a.cc:8:1: error: 'll' does not name a type
    8 | ll comb(ll n, ll r){
      | ^~
a.cc: In function 'int main()':
a.cc:20:10: error: 'll' was not declared in this scope
   20 |   vector<ll> v(N);
      |          ^~
a.cc:20:12: error: template argument 1 is invalid
   20 |   vector<ll> v(N);
      |            ^
a.cc:20:12: error: template argument 2 is invalid
a.cc:22:14: error: request for member 'at' in 'v', which is of non-class type 'int'
   22 |     cin >> v.at(i);
      |              ^~
a.cc:24:10: error: request for member 'begin' in 'v', which is of non-class type 'int'
   24 |   sort(v.begin(), v.end(), greater<long long>());
      |          ^~~~~
a.cc:24:21: error: request for member 'end' in 'v', which is of non-class type 'int'
   24 |   sort(v.begin(), v.end(), greater<long long>());
      |                     ^~~
a.cc:25:5: error: expected ';' before 'sum'
   25 |   ll sum = 0;
      |     ^~~~
      |     ;
a.cc:27:5: error: 'sum' was not declared in this scope
   27 |     sum += v.at(i);
      |     ^~~
a.cc:27:14: error: request for member 'at' in 'v', which is of non-class type 'int'
   27 |     sum += v.at(i);
      |              ^~
a.cc:29:5: error: expected ';' before 'num'
   29 |   ll num = 0;
      |     ^~~~
      |     ;
a.cc:30:5: error: expected ';' before 'chosen'
   30 |   ll chosen = 0;
      |     ^~~~~~~
      |     ;
a.cc:33:10: error: request for member 'at' in 'v', which is of non-class type 'int'
   33 |     if(v.at(i)==v.at(A-1)){
      |          ^~
a.cc:33:19: error: request for member 'at' in 'v', which is of non-class type 'int'
   33 |     if(v.at(i)==v.at(A-1)){
      |                   ^~
a.cc:34:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   34 |       num++;
      |       ^~~
      |       enum
a.cc:35:15: error: 'chosen' was not declared in this scope
   35 |       if(i<A) chosen++;
      |               ^~~~~~
a.cc:37:10: error: request for member 'at' in 'v', which is of non-class type 'int'
   37 |     if(v.at(i)!=v.at(0)) all_equal = false;
      |          ^~
a.cc:37:19: error: request for member 'at' in 'v', which is of non-class type 'int'
   37 |     if(v.at(i)!=v.at(0)) all_equal = false;
      |                   ^~
a.cc:39:5: error: expected ';' before 'mtd'
   39 |   ll mtd = 0;
      |     ^~~~
      |     ;
a.cc:42:7: error: 'mtd' was not declared in this scope; did you mean 'std'?
   42 |       mtd += comb(num,i);
      |       ^~~
      |       std
a.cc:42:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   42 |       mtd += comb(num,i);
      |                   ^~~
      |                   enum
a.cc:42:14: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   42 |       mtd += comb(num,i);
      |              ^~~~
      |              wctomb
a.cc:45:5: error: 'mtd' was not declared in this scope; did you mean 'std'?
   45 |     mtd += comb(num,chosen);
      |     ^~~
      |     std
a.cc:45:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   45 |     mtd += comb(num,chosen);
      |                 ^~~
      |                 enum
a.cc:45:21: error: 'chosen' was not declared in this scope
   45 |     mtd += comb(num,chosen);
      |                     ^~~~~~
a.cc:45:12: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   45 |     mtd += comb(num,chosen);
      |            ^~~~
      |            wctomb
a.cc:47:11: error: 'sum' was not declared in this scope
   47 |   cout << sum/A << endl;
      |           ^~~
a.cc:48:11: error: 'mtd' was not declared in this scope; did you mean 'std'?
   48 |   cout << mtd;
      |           ^~~
      |           std