Control C301A

A natural number n > 0 is called powerful if, for each prime divisor p
of n, p² is also divisor of n. For example,
55125 = 3 ⋅ 3 ⋅ 5 ⋅ 5 ⋅ 5 ⋅ 7 ⋅ 7 is a powerful number, because every
prime factor appears, at least, twice.

Your task is to write a program that reads a sequence of numbers m and,
for each one, prints all the powerful numbers between 1 and m.

Input

The input is a sequence of natural numbers m > 0.

Output

For each m of the input, print a line with all the powerful numbers
between 1 and m, separated by commas and in increasing order.

Observation

Your program must implement and use the function

        bool is_powerful(int n);

that, given an integer strictly positive |n|, indicates if is powerful
or is not

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:26:34.278Z

© Jutge.org, 2006–2026.
https://jutge.org
