#include using namespace std; void debug(const char *msg, ...) { #ifdef CLESIP va_list arg; static char pbString[512]; va_start(arg,msg); vsprintf(pbString,msg,arg); cerr << "[DEBUG] " << pbString << "\n"; va_end(arg); #endif } using i64 = long long; using i128 = __int128_t; template void chkmax(T &x, L y) { if (x < y) x = y; } template void chkmin(T &x, L y) { if (x > y) x = y; } const int N = 5010; int f[N], n; i64 a[N], l, r; void solve() { cin >> n >> l >> r; for (int i = 1; i <= n; i ++) cin >> a[i]; sort(a + 1, a + 1 + n); auto check = [&](i64 val) { return l <= val && val <= r; }; int ans = 0; for (int i = 1; i < n; i ++) { if (!check(a[i] * a[i + 1])) continue; int j = i + 1; i64 mn = min(a[i], a[i + 1]), mx = max(a[i], a[i + 1]); while (j + 1 <= n && check(mn * a[j + 1]) && check(mx * a[j + 1])) { chkmax(mx, a[j + 1]); chkmin(mn, a[j + 1]); j ++; } chkmax(ans, j - i + 1); } cout << ans; } int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); solve(); return 0; }