#include using namespace std; #define ll long long #define pii pair #define piii pair #define pll pair #define plll pair #define fi first #define se second const int N = 2e5 + 5, M = 1e6 + 5; const int inf = 1e9, mod = 998244353; const ll INF = 1e18; namespace ARIS0_0{ int n, d[N], x, y; void init(){ } int get(int a, int b){ assert(a <= 2 * b); if (a % b == 0) return a / b; return 2; } void solve(){ int n; cin >> n; for (int i = 1; i <= n; i ++ ) cin >> d[i]; cin >> x >> y; int mxd = 0; for (int i = 1; i <= n; i ++ ) mxd = max(mxd, d[i]); if (x < 0) x = -x; if (y < 0) y = -y; if (x == 0 && y == 0){ cout << "0\n"; return ; } int qwq = max(x, y); for (int i = 1; i <= n; i ++) if (qwq == d[i]){ cout << "1\n"; return ; } if (qwq < 2 * mxd){ cout << get(qwq, mxd) << "\n"; return ; } int fir = (qwq - 2 * mxd); int x = (fir - 1) / mxd + 1; cout << x + get(qwq - x * mxd, mxd) << "\n"; } void single(){ init(), solve(); } void multi(){ init(); int T; cin >> T; while (T -- ) solve(); } void idmulti(){ init(); int id, T; cin >> id >> T; while (T -- ) solve(); } }; signed main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ARIS0_0::single(); } /* 到达 (x, y) (x <= 2d, y <= 2d) 可以通过 (0, 0) -> (x - d, d) -> (x, y) 走到 然后咋搞,感觉有很多细节啊 */