#CCBCHBAHAI0000135. Chuẩn hóa dấu (Sign Normalization)
Chuẩn hóa dấu (Sign Normalization)
Sign Normalization
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer array , replace each value by its sign:
$$s_i=\begin{cases} -1,&a_i<0,\\ 0,&a_i=0,\\ 1,&a_i>0. \end{cases}$$Print .
Input
- The first line contains .
- The second line contains integers .
Output
Print one line containing values from separated by single spaces.
Subtasks
Subtask 1 (100 points): and .
Examples
Input
7
-5 0 8 -1 1 0 20
Output
-1 0 1 -1 1 0 1
Explanation
Negative values -5 and -1 become -1; zeros remain 0; positive values 8, 1, and 20 become 1.