Codeforces Round 277 (Div. 2)
翻译中…
For a positive integer $*n*$ let's define a function $*f*$:
翻译中…
$*f*(*n*) = - 1 + 2 - 3 + .. + ( - 1)^{*n*}*n*$
翻译中…
Your task is to calculate $*f*(*n*)$ for a given integer $*n*$.
翻译中…
Input
翻译中…
The single line contains the positive integer $*n*$ ($1 ≤ *n* ≤ 10^{15}$).
翻译中…
Output
翻译中…
Print $*f*(*n*)$ in a single line.
翻译中…
Note
翻译中…
$*f*(4) = - 1 + 2 - 3 + 4 = 2$
翻译中…
$*f*(5) = - 1 + 2 - 3 + 4 - 5 = - 3$
翻译中…
样例
Input #1
4
Output #1
2
InputCopy
OutputCopy
Input #2
5
Output #2
-3
InputCopy
OutputCopy
题目信息
标签
模拟
数学
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。