#P10171. [DTCPC 2024] 取模

    ID: 11528 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>2024数论快速傅里叶变换 FFT洛谷月赛

[DTCPC 2024] 取模

Problem Description

Given a sequence {an}\{a_n\} and an interval [L,R][L,R], ask how many integers k[L,R]k\in [L,R] satisfy that all values aimodka_i \bmod k are pairwise distinct.

Input Format

The first line contains three positive integers n,L,Rn, L, R (n5×104,1LR109n\leq 5\times 10^4, 1\leq L\leq R\leq 10^9).

The second line contains nn positive integers representing {an}\{a_n\} (0<ai4×1050 < a_i\leq 4\times 10^5).

Output Format

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

3 1 3
11 7 6
1

Hint

Translated by ChatGPT 5