亲和数对
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

求在给定区间[start,end]内所有的亲和数对。
亲和数的定义:对于数对(A,B),如果A的除了自己外的所有约数的和等于B,并且B的所有除了自己外的所有约数的和等于A,那么就称(A,B)为一组亲和数。
如果A=B,只需输出A即可,否则按照其中较小的一个数为第一关键字排序输出。

输入描述:

Line 1: Two space-separated integers: start and end (1 <= start <= end <= 500000)

输出描述:

Lines 1..?: Each line contains a space-separated list that represents one chain of numbers calculated using the described bess() function.
示例1

输入

复制
200 1200

输出

复制
220 284
496
1184 1210