#include using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; #define X first #define Y second #define SZ(a) ((int)a.size()) #define ALL(v) v.begin(), v.end() #define pb push_back ll arr[10005]; int main() { ios::sync_with_stdio(0), cin.tie(0); int n; ll l, r; cin >> n >> l >> r; for (int i = 1; i <= n; ++i) cin >> arr[i]; int ans = 1; sort(arr + 1, arr + n + 1); for (int i = 1; i <= n; ++i) arr[i + n] = arr[i]; n += n; auto in_itv = [&](ll x) { return clamp(x, l, r) == x; }; for (int i = 1; i <= n; ++i) { for (int j = i + 1; j <= n && j - i + 1 <= n; ++j) { if (in_itv(arr[i] * arr[i + 1]) && in_itv(arr[i] * arr[j]) && in_itv(arr[j - 1] * arr[j])) ans = max(ans, j - i + 1); else break; } } cout << ans << "\n"; }