#P9489. Representable Number Count

    ID: 22638 Type: Default 1000ms 256MiB

Representable Number Count

Representable Number Count

Define a positive integer \(x\) as 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 \)

Given a sequence of \(n\) positive integers \(x_1, x_2, \dots, x_n\) and an interval \([l, r]\), determine how many integers \(x\) within the interval \([l, r]\) are representable.

inputFormat

The first line contains three positive integers \(n\), \(l\), and \(r\) separated by spaces.

The second line contains \(n\) positive integers \(x_1, x_2, \dots, x_n\) separated by spaces.

outputFormat

Output a single integer representing the count of representable numbers in the interval \([l, r]\).

sample

1 1 10
2
10

</p>