Initial values of elements 3
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
To each positive element of an array with N integers, the largest element of the array was added. For each negative element, the smallest element was added. The resulting values were then input into the program without altering their order. Your task is to reconstruct the original values of the array elements.
Input
The first line contains a natural number N. The second line contains N integers. Each number has an absolute value not exceeding 100.
Output
Output the original values of the array elements in a single line, separated by spaces.
Examples
Input #1
Answer #1
Input #3
Answer #3
Submissions 4K
Acceptance rate 35%