1190 列出完数


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

自然数中,完数寥若晨星,请在从1到某个整数范围中打印出所有的完数来。 所谓“完数”是指一个数恰好等于它的所有不同因子之和。例如,6是完数,因为6=1+2+3。而24不是完数,因为24≠1+2+3+4+6+8+12=36。

Input

输入数据中含有一些整数n(1<n<=10000)。

Output

对于每个整数n,输出所有不大于n的完数。每个整数n的输出由n引导,跟上冒号,然后是由空格开道的一个个完数,每个n的完数列表应占独立的一行。

Sample

Input

100
5000

Output

100: 6 28
5000: 6 28 496

Source: qianneng


Comments

There are no comments at the moment.