Toggle navigation
Home
Problems
Contests
Experiments
Status
Standings
Discuss
News
Login
Register
为了相同的前缀-公式计算
Time Limit: 1000 ms
Memory Limit: 65536 KiB
Submit
Statistic
Discuss
Problem Description
定义一个函数f(n)=-1+2-3+4-5+6+...+(-1)^(n)*n.输入一个n,输出f(n)的值。
Input
多组输入。每组输入为一行一个整数n。(1<=n<=10^15).
Output
每组测试数据输出单独一行一个整数代表f(n)的值。
Sample Input
4 5
Sample Output
2 -3
Hint
Source
ff