#K53542. Increment Even Numbers
Increment Even Numbers
Increment Even Numbers
You are given a list of integers. Your task is to increment each even integer by 1 while keeping odd integers unchanged.
Formally, given an array \(A = [a_1, a_2, \dots, a_n]\), you need to produce an array \(B = [b_1, b_2, \dots, b_n]\) such that:
\[ b_i = \begin{cases} a_i + 1, & \text{if } a_i \text{ is even}\\ a_i, & \text{if } a_i \text{ is odd} \end{cases} \]
The input will be read from stdin and output should be printed to stdout.
inputFormat
The first line of input contains a non-negative integer n representing the number of elements in the list. The second line contains n space-separated integers.
If n equals 0, the second line will be empty.
outputFormat
Output a single line containing the modified array with the even numbers incremented by 1. The numbers should be printed in the same order as the input and separated by a single space.
## sample5
1 2 3 4 5
1 3 3 5 5