output_description: If TopCoDeer is honest, print `H`. If he is dishonest, print `D`.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      a b
attempt: import sys
  
  N, K = map(int, input().split())
  a = list(map(int, input().split()))
  sum = 0
  for i in range(0, N):
      sum += a[i]
  if sum < K:  # 全部不必要
      print(N)
      sys.exit()
  if sum == K:  # 全部必要
      print(0)
      sys.exit()
  a.sort()
  a.reverse()
  
  # K未満の最大の数字のラベルはどこ？
  l = N
  for i in range(N - 1, -1, -1):
      if a[i] < K:
          l = i
      else:
          break
  
  if l == N:
      print(N)
      sys.exit()
  
  count = N
  # lまでの要素が必要か不要かチェック
  for i in range(0, l):
      sum = 0
      for j in range(l, N):
          if sum + a[j] < K:
              sum += a[j]
      if sum + a[i] >= K:  # 必要ってことだ
          count -= 1
  # lからの要素は自分のことを抜かないといけないことに注意
  for i in range(l, N):
      sum = 0
      b = a[:]
      C = b.pop(i)
      for j in range(l - 1, N - 1):
          if sum + b[j] < K:
              sum += b[j]
      if sum + C >= K:  # 必要ってことだ
          count -= 1
  print(count)
  
problem_description: Statement
  
  Two deer, AtCoDeer and TopCoDeer, are playing a game called _Honest or
  Dishonest_. In this game, an honest player always tells the truth, and an
  dishonest player always tell lies. You are given two characters a and b as the
  input. Each of them is either `H` or `D`, and carries the following
  information:
  
  If a=`H`, AtCoDeer is honest; if a=`D`, AtCoDeer is dishonest. If b=`H`,
  AtCoDeer is saying that TopCoDeer is honest; if b=`D`, AtCoDeer is saying that
  TopCoDeer is dishonest.
  
  Given this information, determine whether TopCoDeer is honest.
samples: [{"input": "H H", "output": "H\n    \n\nIn this input, AtCoDeer is honest. Hence, as he says, TopCoDeer is honest.\n\n* * *"}, {"input": "D H", "output": "D\n    \n\nIn this input, AtCoDeer is dishonest. Hence, contrary to what he says,\nTopCoDeer is dishonest.\n\n* * *"}, {"input": "D D", "output": "H"}]