output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K S T
      A_1 A_2 ... A_N
attempt: N, K, S, T = map(int, input().split())
  A = list(map(int, input().split()))
  
  bin_str = format(S, '08b')
  c = 0
  for l in range(2**N):
    binstr_l = format(l, '050b')
    lnum = 0
    for i in range(50):
      if binstr_l[i] == 1:
        lnum += 1
    if lnum > K:
      break
    a = 2**18-1
    o = 0
    for i in range(N):
      if(binstr_l[50-1 - i] == '1'):
        a = a & A[i]
        o = o | A[i]
    if a == S and o == T:
      c += 1
  print(c)
problem_description: Statement
  
  Given are N pairwise distinct non-negative integers A_1,A_2,\ldots,A_N. Find
  the number of ways to choose a set of between 1 and K numbers (inclusive) from
  the given numbers so that the following two conditions are satisfied:
  
    * The bitwise AND of the chosen numbers is S.
    * The bitwise OR of the chosen numbers is T.
samples: [{"input": "3 3 0 3\n    1 2 3", "output": "2\n    \n\nThe conditions are satisfied when we choose \\\\{1,2\\\\} or \\\\{1,2,3\\\\}.\n\n* * *"}, {"input": "5 3 1 7\n    3 4 9 1 5", "output": "2\n    \n\n* * *"}, {"input": "5 4 0 15\n    3 4 9 1 5", "output": "3"}]