当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1220:Friends number

题目描述

Paula and Tai are couple. There are many stories between them. The day Paula left by airplane, Tai send one message to telephone 2200284, then, everything is changing… (The story in “the snow queen”).

After a long time, Tai tells Paula, the number 220 and 284 is a couple of friends number, as they are special, all divisors of 220’s sum is 284, and all divisors of 284’s sum is 220. Can you find out there are how many couples of friends number less than 10,000. Then, how about 100,000, 200,000 and so on.

The task for you is to find out there are how many couples of friends number in given closed interval [a,b]

输入解释

There are several cases.

Each test case contains two positive integers a, b(1<= a <= b <=5,000,000).

Proceed to the end of file.

输出解释

For each test case, output the number of couples in the given range. The output of one test case occupied exactly one line.

输入样例
1 100
1 1000
输出样例
0
1
提示

6 is a number whose sum of all divisors is 6. 6 is not a friend number, these number is called Perfect Number.


该题目包含在题集 ACM赛制

题目来源 辽宁省赛2010

共提交 3

通过率 100.0%
时间上限 内存上限
1000 MS 128 MB