#P15798. [GESP202603 五级] 有限不循环小数

[GESP202603 五级] 有限不循环小数

Background

Related multiple-choice and true/false problems: https://ti.luogu.com.cn/problemset/1209.

Problem Description

If 1a\frac{1}{a} can be converted into a finite, non-repeating decimal, then aa is called a terminating number.

Please find the number of terminating numbers in the range from LL to RR.

Input Format

Input one line containing two integers L,RL, R.

Output Format

Output one line containing one integer, representing the number of terminating numbers in the range from LL to RR.

2 11
5

Hint

Sample Explanation

In [2,11][2, 11], the terminating numbers are 22, 44, 55, 88, and 1010.

Constraints

It is guaranteed that 1LR1061 \le L \le R \le 10^6.

Translated by ChatGPT 5