#include #include #include using namespace std; #define NMAX 40 typedef struct s{ long long P; bool ok[NMAX]; } S; int N,B; long long A[NMAX]; vector l,h; bool sel[NMAX]; bool search_end; bool ok[NMAX]; bool operator<(S a,S b){ if(a.P==b.P){ for(int i=0;i>N; cin>>B; for(int i=0;i>A[i]; sel[i]=false; } for(int i=0;iB-l[i].P){ rig=mid-1; } else break; } if(h[mid].P==B) continue; if(h[mid].P==B-l[i].P){ while(mid>=1){ if(h[mid].P==h[mid-1].P) mid--; else break; } int f=true; while(mid