Control C301A

A natural number n>0n > 0 is called powerful if, for each prime divisor pp of nn, p2p^2 is also divisor of nn. For example, 55125=335557755125 = 3\cdot3\cdot5\cdot5\cdot5\cdot7\cdot7 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 mm and, for each one, prints all the powerful numbers between 1 and mm.

Input

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

Output

For each mm of the input, print a line with all the powerful numbers between 1 and mm, 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