#K15201. List Transformation Challenge
List Transformation Challenge
List Transformation Challenge
You are given a list of integers. Your task is to perform the following operations in order:
- Reverse the list.
- Replace each element with its square (i.e., compute for each element ).
- Remove all elements that are even (i.e., keep only those elements for which ).
Finally, print the resulting list as a space-separated string. If the list becomes empty after the transformation, output an empty line.
inputFormat
The first line contains an integer , representing the number of elements in the list. The second line contains space-separated integers.
outputFormat
Output a single line with the transformed list's integers separated by a single space. If no integers remain after processing, output an empty line.## sample
5
1 2 3 4 5
25 9 1