output_description: Print the hour of the starting time of the contest in 24-hour time.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      A B
attempt: def ncr(x, y):
      ans = 1
      q = x - y
      while x > y:
          ans *= x
          x = x - 1
  
      while q > 1:
          ans = ans / q
          q = q - 1
  
      return ans
  
  
  x = input().split()
  n = int(x[0])
  a = int(x[1])
  b = int(x[2])
  v = [0] * n
  x = input().split()
  ind = 0
  M = {1: 0}
  M2 = {1: 0}
  for i in x:
      v[ind] = int(i)
      if int(i) in M:
          M[v[ind]] += 1
      else:
          M[v[ind]] = 1
      ind += 1
  v.sort(reverse=True)
  
  cnt = 0
  ind = 0
  m = 0
  while cnt < a:
      cnt += 1
      m = ((cnt - 1) * m + v[ind]) / cnt
      if v[ind] in M2:
          M2[v[ind]] += 1
      else:
          M2[v[ind]] = 1
      ind += 1
  while cnt < b:
      if (cnt * m + v[ind]) / (cnt + 1) < m - 0.5:
          break
      else:
          cnt += 1
          if v[ind] in M2:
              M2[v[ind]] += 1
          else:
              M2[v[ind]] = 1
          ind += 1
  print(m)
  maxw = cnt
  ways = 0
  for i in range(cnt, a - 1, -1):
      if v[ind - 1] not in M2:
          M2[v[ind]] = 0
      if v[ind - 1] not in M:
          M[v[ind - 1]] = 0
      ways += ncr(M[v[ind - 1]], M2[v[ind - 1]])
  
      M2[v[ind - 1]] -= 1
  
  print(int(ways))
  
problem_description: Statement
  
  Dolphin loves programming contests. Today, he will take part in a contest in
  AtCoder.  
  In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
  as "21 o'clock".  
  The current time is A o'clock, and a contest will begin in exactly B hours.
  When will the contest begin? Answer in 24-hour time.
samples: [{"input": "9 12", "output": "21\n    \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n    \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n    \n\nThe contest will begin at 1 o'clock the next day."}]