#include using namespace std; #define int long long signed main() { int N, D[100000], X, Y; cin >> N; for(int i = 0; i < N; i++) { cin >> D[i]; } cin >> X >> Y; if(X == 0 && Y == 0) { cout << 0 << endl; return (0); } int F = abs(X) + abs(Y); for(int i = 0; i < N; i++) { if(F == D[i]) { cout << 1 << endl; return (0); } } int Z = *max_element(D, D + N); if(Z * 2 >= F) { cout << 2 << endl; return (0); } cout << -1 << endl; }