#C14590. Even Numbers Multiplied by Their Index
Even Numbers Multiplied by Their Index
Even Numbers Multiplied by Their Index
This problem requires you to read a list of integers and produce a new list that contains only the even numbers from the input list. However, rather than simply copying the even numbers, you should multiply each even number by its corresponding index in the input list.
An integer x is even if it can be written in the form \(2k\) for some integer \(k\). For each even number found at index \(i\) (starting from \(0\)), compute \(i \times x\) and include it in the output.
The input is given via standard input (stdin) and the output should be written to standard output (stdout). If there are no even numbers in the list, output an empty line.
inputFormat
The first line of input contains a single integer \(n\) representing the number of elements in the list. The second line contains \(n\) space-separated integers representing the list elements.
Example:
4 2 3 4 5
outputFormat
Output a single line containing the resulting list of numbers, where each even number is multiplied by its index in the input list. The numbers should be printed separated by a single space. If there are no even numbers, print an empty line.
Example:
0 8## sample
4
2 3 4 5
0 8
</p>