#include //#include using namespace std; //using namespace atcoder; #define rep(i,a,n) for (int i = a; i < (n); i++) #define all(x) (x).begin(),(x).end() using ll = long long; using P = pair; using Graph = vector>; int mod = 998244353; int INF = 1001001001; using pll = pair; int Flag=0; //デフォルトでNoがでる void yn(int Flag){ if(Flag==1){ cout<<"Yes"< &V){ int n=V.size(); rep(i,0,n){ for(auto x:V[i]){ cerr<>H>>W; vector> C(H,vector (W)); rep(i,0,H) rep(j,0,W) cin>>C[i][j]; */ int main(){ int N,K; cin>>N>>K; vector

y(N); rep(i,0,N){ cin>>y[i].first; y[i].second=i; } sort(all(y)); ll sum=0; int idx=-1; for(auto& x:y){ auto [i,j]=x; if(sum+i>K){ idx=j+1; break; } sum+=i; } cout<<(idx==-1 ? N : idx)<<" "; cout<