n,l,r=map(int,input().split()) A=list(map(int,input().split())) if r<0: for i in range(n): for j in range(i+1,n): if l<=A[i]*A[j]<=r: print(2) exit() print(1) exit() PLUS=[] MINUS=[] zero=0 for a in A: if a>0: PLUS.append(a) elif a<0: MINUS.append(a) else: zero+=1 PLUS.sort() MINUS.sort(reverse=True) def check(x,y,A): for i in range(x+1,x+3): if x<=i<=y: if x!=i: if l<=A[x]*A[i]<=r: pass else: return False if y!=i: if l<=A[y]*A[i]<=r: pass else: return False for i in range(y-2,y): if x<=i<=y: if x!=i: if l<=A[x]*A[i]<=r: pass else: return False if y!=i: if l<=A[y]*A[i]<=r: pass else: return False return True if l>0: ANS=1 for i in range(len(PLUS)): for j in range(i,len(PLUS)): if check(i,j,PLUS)==True: ANS=max(ANS,j-i+1) for i in range(len(MINUS)): for j in range(i,len(MINUS)): if check(i,j,MINUS)==True: ANS=max(ANS,j-i+1) print(ANS) exit() ANS=1 for i in range(len(PLUS)+1): for j in range(len(MINUS)+1): x0=0 if i-2>=0: x0=PLUS[i-2] x1=0 if i-1>=0: x1=PLUS[i-1] y0=0 if j-2>=0: y0=MINUS[j-2] y1=0 if j-1>=0: y1=MINUS[j-1] LIST=[x0,x1,y0,y1] #print(i,j,LIST) flag=1 for k in range(4): for m in range(k+1,4): if l<=LIST[k]*LIST[m]<=r: pass else: flag=0 if flag==1: ANS=max(ANS,i+j) print(ANS)