output_description: Print the number of combinations in a line.
input_description: The input is given in the following format.
  
      
      
      N K L R
      a1 a2 ... aN
attempt: from itertools import combinations as C
  
  N, K, L, R = map(int, input().split())
  a = list(map(int, input().split()))
  v = [i for i in range(N)]
  ans = 0
  for ii in list(C(v, K)):
      tmp = 0
      flag = True
      for i in ii:
          tmp += a[i]
          if tmp > R:
              flag = False
              break
      if flag and tmp >= L:
          ans += 1
  print(ans)
  
problem_description: Coin Combination Problem II
  
  You have N coins each of which has a value ai. Find the number of combinations
  that result when you choose K different coins in such a way that the total
  value of the coins is greater than or equal to L and less than or equal to R.
samples: [{"input": "2 2 1 9\n    5 1", "output": "1"}, {"input": "5 2 7 19\n    3 5 4 2 2", "output": "5"}]