-->
当前位置:首页 > 题库

PROGRAMMING:Finding affinity number pairs**

Luz5年前 (2021-05-10)题库479
The so-called affinity number pair refers to two different natural numbers, in which the sum of the true factors of any number is exactly equal to the other number. For example, 220 and 284 are a pair of affinity numbers.
All true factors of 220 include: 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110, and their sum is exactly 284;
All the true factors of 284 include: 1, 2, 4, 71, 142, and their sum is exactly 220.
It is said that two good friends can keep a good friendship by wearing amulets with affinity pairs.
Please write a program to input the lower limit and upper limit of the interval. If there are affinity pairs in the interval, all affinity pairs in the interval will be output, otherwise none will be output.
####Input format:
>Two positive integers a and B, and a ≤ B ≤ 100000000, that is, the lower limit and upper limit of the interval [a, b]
####Output format:
>If there are affinity pairs, several rows are output, one affinity pair for each row is in the interval [a, b], and the former is less than the latter, and the two are separated by spaces; Otherwise, output none.
####Input sample 1
```in
1000 3000
```
####Output sample 1
```out
1184 1210
2620 2924
```
####Input sample 2
```in
7000 9000
```
####Output sample 2
```out
None
```







answer:If there is no answer, please comment