#include #include #include using namespace std; int main(){ int n,x,y,d,idx; int S = 0; //回数 vector v; cin >> n; while(n--){ int x; cin >> x; v.push_back(x); } cin >> x >> y; d = max({abs(x),abs(y)}); sort(v.begin(),v.end()); idx = v.size()-1; while(d!=0){ if(2*v[idx] < d){ S = S+1; d = abs(d - v[idx]); } else if(find(v.begin(),v.end(),d)!=v.end()){ S = S + 1; break; } else{ S = S + 2; break; } } cout << S << endl; return 0; }