output_description: Print the earliest possible time for the kangaroo to reach coordinate X.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      X
attempt: # import sys
  # sys.stdin = open('d3.in')
  
  n, k = map(int, input().split())
  a = list(map(int, input().split()))
  a.sort()
  
  prefix = [set() for _ in range(n + 1)]
  suffix = [set() for _2 in range(n + 1)]
  
  prefix[0] = {0}
  for i in range(n):
      for v in prefix[i]:
          if v + a[i] <= k:
              prefix[i + 1].add(v + a[i])
  
  suffix[n] = {0}
  for i in range(n - 1, -1, -1):
      suffix[i] = set(suffix[i + 1])
      for v in suffix[i + 1]:
          if v + a[i] <= k:
              suffix[i].add(v + a[i])
  
  # Cumulative sums
  c_suffix = [[0] * (k + 1) for _3 in range(n + 1)]
  for i in range(n + 1):
      for j in range(k):
          c_suffix[i][j + 1] = c_suffix[i][j] + (j in suffix[i])
  
  
  def find(i):
      if k <= a[i]:
          return 0
      for s in prefix[i]:
          start = max(0, k - a[i] - s)
          stop = k - s
          if c_suffix[i + 1][stop] - c_suffix[i + 1][start] > 0:
              return 0
      return 1
  
  
  res = 0
  for i in range(n):
      res += find(i)
  print(res)
  
problem_description: Statement
  
  There is a kangaroo at coordinate 0 on an infinite number line that runs from
  left to right, at time 0. During the period between time i-1 and time i, the
  kangaroo can either stay at his position, or perform a jump of length exactly
  i to the left or to the right. That is, if his coordinate at time i-1 is x, he
  can be at coordinate x-i, x or x+i at time i. The kangaroo's nest is at
  coordinate X, and he wants to travel to coordinate X as fast as possible. Find
  the earliest possible time to reach coordinate X.
samples: [{"input": "6", "output": "3\n    \n\nThe kangaroo can reach his nest at time 3 by jumping to the right three times,\nwhich is the earliest possible time.\n\n* * *"}, {"input": "2", "output": "2\n    \n\nHe can reach his nest at time 2 by staying at his position during the first\nsecond, and jumping to the right at the next second.\n\n* * *"}, {"input": "11", "output": "5"}]