Calculate the value of y according to the given conditions:
An integer x~(-1000 \le x \le 1000).
Print the value of y according to the given conditions.
Example 1
Example 2