Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
248 B
0
Indexable
Never

#include <iostream>
using namespace std;

int main()
{
    long long n;
    cin >> n;
    long long sum = 0;
    if (n % 2 != 0) {
        sum = ((n / 2) * (-1)) - 1;
    }
    else sum = n / 2;

    
    cout << sum;
    
}

Leave a Comment