#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n >> k; bitset<2000001> ans; ans[0] = 1; re(i, n){ ll t;std::cin >> t; ans |= (ans << t); } for(int i=k;i>=0;i--){ if(ans[i]){ std::cout << i << '\n'; return 0; } } }