output_description: Print the number of the unnecessary cards.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N K
      a_1 a_2 ... a_N
attempt: #include <bits/stdc++.h>
  using namespace std;
  #define REP(i, n) for(int i = 0;i < n;i++)
  #define REPR(i, n) for(int i = n;i >= 0;i--)
  #define FOR(i, m, n) for(int i = m;i < n;i++)
  #define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
  typedef long long llong;
  char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
  #define Sort(a) sort(a.begin(),a.end());
  #define Reverse(a) reverse(a.begin(),a.end());
  #define print(a) cout << a << endl;
  #define n_max 5005
  
  
  int A[n_max];
  int n,k;
  
  bool judge( int ind){
      int dp[5000]={};
      if(A[ind] >=k) return true;
      dp[0]=1;
      REP(i,n){
          int a= A[i];
          if(i==ind) continue;
          REPR(j,k){
              if( j-a >= 0 and dp[j-a] ==1 ) dp[j]=1;
          }
      }
      FOR(i,k-A[ind],k) if(dp[i] == 1) return true;
      return false;
  }
  int main(){
      cin >> n >> k;
      REP(i,n) cin >> A[i];
      sort(A,A+n);
      int left = -1;
      int right = n-1;
      int mid;
      while(1){
          if(left + 1 >= right ) break;
          mid=(left + right) / 2;
          if(judge(mid)){
              right= mid-1 ;
          }
          else left = mid;
      }
  
      if(judge(right)){
          cout << left + 1  << endl;
      }
      else cout << right +1 << endl;
  
  
  }
problem_description: Statement
  
  AtCoDeer the deer has N cards with positive integers written on them. The
  number on the i-th card (1≤i≤N) is a_i. Because he loves big numbers, he calls
  a subset of the cards _good_ when the sum of the numbers written on the cards
  in the subset, is K or greater.
  
  Then, for each card i, he judges whether it is _unnecessary_ or not, as
  follows:
  
    * If, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.
    * Otherwise, card i is NOT unnecessary.
  
  Find the number of the unnecessary cards. Here, he judges each card
  independently, and he does not throw away cards that turn out to be
  unnecessary.
samples: [{"input": "3 6\n    1 4 3", "output": "1\n    \n\nThere are two good sets: {2,3} and {1,2,3}.\n\nCard 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is\nalso good. Thus, card 1 is unnecessary.\n\nFor card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is\nNOT unnecessary.\n\nNeither is card 3 for a similar reason, hence the answer is 1.\n\n* * *"}, {"input": "5 400\n    3 1 4 1 5", "output": "5\n    \n\nIn this case, there is no good set. Therefore, all the cards are unnecessary.\n\n* * *"}, {"input": "6 20\n    10 4 3 10 25 2", "output": "3"}]