#include using namespace std; using ll = long long; int main () { int N; ll L, R; cin >> N >> L >> R; ll A[5050]; for (int i = 0; i < N; i ++) cin >> A[i]; int ans = 1; for (int l = 0; l < N - 1; l ++) { ll mn[] = {-1, -1}, pl[] = {-1, -1}; for (int r = l; r <= N; r ++) { if (r == N) { ans = max(ans, N - l); continue; } bool ok = true; if (A[r] == 0) { if (L * R > 0) { ok = false; } } else if (A[r] < 0) { ll a = A[r] * -1; if (a > mn[0]) { mn[1] = mn[0]; mn[0] = a; } else if (a > mn[1]) { mn[1] = a; } } else { ll a = A[r]; if (a > pl[0]) { pl[1] = pl[0]; pl[0] = a; } else if (a > mn[1]) { mn[1] = a; } } if (pl[0] > 0 && mn[0] > 0) { ll x = pl[0] * mn[0] * -1; ok = ok && (L <= x) && (x <= R); } if (pl[1] > 0) { ll x = pl[0] * pl[1]; ok = ok && (L <= x && x <= R); } if (mn[1] > 0) { ll x = mn[0] * mn[1]; ok = ok && (L <= x && x <= R); } if (!ok) { ans = max(ans, r - l); break; } } } cout << ans << endl; }