#include using namespace std; int main() { int n, l, r; cin >> n >> l >> r; vector A(n); for (int i = 0; i < n; i++){ cin >> A[i]; } int ans = 0; sort(A.begin(), A.end()); for (int i = 0; i < n; i++){ vector p, m; for (int j = i; j < n; j++){ if (A[j] > 0){ p.push_back(A[j]); } else { m.push_back(A[j]); } bool ok = true; if ((int) p.size() >= 2){ long long c = (long long) p[p.size() - 1] * p[p.size() - 2]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 2){ long long c = (long long) p[p.size() - 1] * p[0]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 2){ long long c = (long long) p[0] * p[1]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[0] * m[1]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[m.size() - 1] * m[m.size() - 2]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[m.size() - 1] * m[0]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[p.size() - 1] * m[0] < l; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[p.size() - 1] * m[m.size() - 1]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[0] * m[m.size() - 1]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[0] * m[0]; if (c < l or r < c){ ok = false; } } if (ok){ ans = max(ans, j - i + 1); } else { break; } } } sort(A.rbegin(), A.rend()); for (int i = 0; i < n; i++){ vector p, m; for (int j = i; j < n; j++){ if (A[j] > 0){ p.push_back(A[j]); } else { m.push_back(A[j]); } bool ok = true; if ((int) p.size() >= 2){ long long c = (long long) p[p.size() - 1] * p[p.size() - 2]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 2){ long long c = (long long) p[p.size() - 1] * p[0]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 2){ long long c = (long long) p[0] * p[1]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[0] * m[1]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[m.size() - 1] * m[m.size() - 2]; if (c < l or r < c){ ok = false; } } if ((int) m.size() >= 2){ long long c = (long long) m[m.size() - 1] * m[0]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[p.size() - 1] * m[0] < l; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[p.size() - 1] * m[m.size() - 1]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[0] * m[m.size() - 1]; if (c < l or r < c){ ok = false; } } if ((int) p.size() >= 1 and (int) m.size() >= 1){ long long c = (long long) p[0] * m[0]; if (c < l or r < c){ ok = false; } } if (ok){ ans = max(ans, j - i + 1); } else { break; } } } cout << ans << endl; }