//#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,avx,avx2,popcnt,tune=native") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #ifdef LOCAL #define eprintf(...) {fprintf(stderr, __VA_ARGS__);fflush(stderr);} #else #define eprintf(...) 42 #endif using ll = long long; using ld = long double; using uint = unsigned int; using ull = unsigned long long; using pii = pair; using pli = pair; using pll = pair; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } #define mp make_pair #define all(x) (x).begin(),(x).end() clock_t startTime; double getCurrentTime() { return (double)(clock() - startTime) / CLOCKS_PER_SEC; } ll floor_div(ll x, ll y) { assert(y != 0); if (y < 0) { y = -y; x = -x; } if (x >= 0) return x / y; return (x + 1) / y - 1; } ll ceil_div(ll x, ll y) { assert(y != 0); if (y < 0) { y = -y; x = -x; } if (x <= 0) return x / y; return (x - 1) / y + 1; } const int N = 5050; int n; ll a[N]; ll l, r; int ans; int main() { startTime = clock(); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); scanf("%d%lld%lld", &n, &l, &r); for (int i = 0; i < n; i++) scanf("%lld", &a[i]); sort(a, a + n); ans = 1; if (r < 0) { for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { ll x = a[i] * a[j]; if (l <= x && x <= r) ans = 2; } printf("%d\n", ans); return 0; } for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { ll x = a[i] * a[i + 1]; ll y = a[i] * a[j]; ll z = a[j - 1] * a[j]; if (min(x, min(y, z)) < l || max(x, max(y, z)) > r) continue; ans = max(ans, j - i + 1); } printf("%d\n", ans); return 0; }