#include #include #include using namespace std; int main(){ int n; cin >> n; vector d(n); for(int i = 0; i < n; i++) cin >> d[i]; sort(d.begin(), d.end()); int x, y; cin >> x >> y; y = max(x, y); int ans = 0, pos = 0; if(abs(y) > 2*d[n-1]){ ans = (abs(y) - 4*d[n-1]) / d[n-1]; if(y-pos > 0) pos = ans * d[n-1]; if(y-pos < 0) pos = -pos; } while(abs(y-pos) > 2*d[n-1]){ ans++; if(y-pos > 0) pos += d[n-1]; else pos -= d[n-1]; } if(abs(y-pos) != 0){ if(*lower_bound(d.begin(), d.end(), abs(y-pos)) == abs(y-pos)){ ans++; }else{ ans += 2; } } cout << ans << endl; return 0; }