###### Codeforces 486A Calculating Function（math）

A. Calculating Function

time limit per test:1 second

memory limit per test:256 megabytes

input:standard input

output:standard output

For a positive integer n let’s define a function f:

f(n) =  - 1 + 2 - 3 + .. + ( - 1)nn

Input

The single line contains the positive integer n (1 ≤ n ≤ 1015).

Output

Print f(n) in a single line.

Sample test(s)

Input
4

Output
2

Input
5

Output
-3

Note

f(4) =  - 1 + 2 - 3 + 4 = 2

f(5) =  - 1 + 2 - 3 + 4 - 5 =  - 3

#include<iostream>
typedef __int64 tt;
using namespace std;

int main()
{
tt n;
while(cin>>n)
{
if(n%2==0) cout<< n/2<<endl;
else  cout<< -n/2-1<<endl;

}
return 0;
}

#### Codeforces 486A Calculating Function(水题)

2014-11-12 23:49:04

#### codeforces 486A Calculating Function

2017-06-01 22:15:01

#### codeforces 486A Calculating Function

2017-12-18 20:29:01

#### codeforces 486A（Calculating Function） Java

2017-07-03 16:02:57

#### 486A - Calculating Function

2015-05-22 15:05:16

#### Codeforces Calculating Function

2017-06-16 09:33:24

#### Codeforces 846B Math Show

2017-09-16 13:43:58

#### A. Calculating Function

2014-11-17 15:50:25

#### UL486A-UL486B

2017年07月08日 317KB 下载

#### Calculating Function

2016-02-26 16:24:35

## 不良信息举报

Codeforces 486A Calculating Function（math）