#C5132. Perfect Numbers Finder

    ID: 48748 Type: Default 1000ms 256MiB

Perfect Numbers Finder

Perfect Numbers Finder

A positive integer (n) is given, and your task is to find all the perfect numbers less than or equal to (n). A perfect number is defined as a number that is equal to the sum of its proper divisors (i.e., all divisors excluding the number itself). For example, (6) is perfect because (1 + 2 + 3 = 6).

Write a program that reads the integer from standard input and prints all the perfect numbers in increasing order on a single line, separated by a space. If no perfect numbers exist in the range, output nothing.

inputFormat

The input consists of a single integer (n) on one line read from standard input.

outputFormat

Print all perfect numbers less than or equal to (n) on one line separated by a single space. If there are no perfect numbers, output an empty line.## sample

6
6

</p>