LearnPy Hub
← Arena
EasyRating 800

Alternating Series

Compute f(n) = −1 + 2 − 3 + 4 − … ± n.

Input

One integer n (1 ≤ n ≤ 10¹⁵).

Output

f(n)

Sample 1

Input
4
Output
2

Sample 2

Input
5
Output
-3
solution.py
Output appears here
Alternating Series · Python Arena problem · LearnPy Hub