#include using namespace std; int main() { int N, M; cin >> N >> M; assert(N <= 25); vector A(N), P(N); for (int i=0; i> A[i]; for (int i=0; i> P[i]; vector B, H{N + 1}; for (int i=0; i<(1< C, D; for (int j=0; j>j) & 1) { sum += A[j]; C.push_back(j); D.push_back(P[j]); } } if (sum == M && D < H) { B = C; H = D; } } if (B.empty()) puts("-1"); else { cout << B.size() << endl; for (int i=0; i