A natural number is called powerful if, for each prime divisor of , is also divisor of . For example, 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 and, for each one, prints all the powerful numbers between 1 and .
The input is a sequence of natural numbers .
For each of the input, print a line with all the powerful numbers between 1 and , separated by commas and in increasing order.
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
Input
27 28 26 1 3 4 270
Output
1,4,8,9,16,25,27 1,4,8,9,16,25,27 1,4,8,9,16,25 1 1 1,4 1,4,8,9,16,25,27,32,36,49,64,72,81,100,108,121,125,128,144,169,196,200,216,225,243,256