#C14273. Square of Primes

    ID: 43904 Type: Default 1000ms 256MiB

Square of Primes

Square of Primes

You are given a list of integers. Your task is to compute the square of each prime number in the list and print them in the order they appear in the input. If a number is not prime, it should be ignored.

A number \( n \) is considered prime if \( n > 1 \) and it has no positive divisors other than 1 and itself. The \( is\_prime(n) \) function can be defined as follows in \( \LaTeX \) format:

\[ is\_prime(n)=\begin{cases} \text{False} & \text{if } n \leq 1,\\ \text{False} & \text{if } \exists\, k \in \mathbb{Z},\, 2 \leq k \leq \sqrt{n} \text{ such that } k \mid n,\\ \text{True} & \text{otherwise.} \end{cases} \]

After determining the prime numbers, square each of them and output the results. Input and output are handled via standard input (stdin) and standard output (stdout), respectively.

inputFormat

The first line of the input contains a single integer \( n \) representing the number of elements in the list. The second line contains \( n \) space-separated integers.

outputFormat

Output a single line containing the squared values of the prime numbers found in the list, separated by a single space. If there are no prime numbers, output an empty line.

## sample
6
4 7 10 11 13 16
49 121 169