P9489 ZHY's Representation Notation

Description

ZHY calls a positive integer $x$ **representable** if and only if there exists a real number $y$ such that $\lfloor \frac y {x_1} \rfloor+\lfloor \frac y {x_2} \rfloor+\cdots + \lfloor \frac y {x_n} \rfloor=x$. Now, ZHY wants to know how many positive integers in the interval $[l,r]$ are representable.

Input Format

The first line contains three positive integers $n,l,r$. The second line contains $n$ positive integers $x_1,x_2,\cdots,x_n$.

Output Format

Output one integer in a single line, representing the answer.

Explanation/Hint

**Sample Explanation** When $x=5$, choose $y=6$ and the condition holds. When $x=6$, choose $y=8$ and the condition holds. When $x=7$, choose $y=9$ and the condition holds. When $x=8$, choose $y=10$ and the condition holds. When $x=10$, choose $y=12$ and the condition holds. Therefore, $5,6,7,8,10$ are representable. It can be proven that for any real number $y$, $\lfloor \frac y {2} \rfloor+\lfloor \frac y {3} \rfloor\ne 9$. Therefore, the answer is $5$. ---- **Constraints** For $30\%$ of the testdata, $l \le r \le 10^5$. For another $10\%$ of the testdata, $n=1$. For $100\%$ of the testdata, $1\le n \le 25$, $1 \le l \le r \le 10^9$, $1 \le x_1,x_2,\cdots,x_n \le 10^9$. Translated by ChatGPT 5