#include <iostream> #include <cmath> using namespace std ; long long fun ( long long n ) { if ( n % 2 == 0 ) return n / 2 ; else return - n + fun ( n - 1 ); } int main () { long long n , sum = 0 ; cin >> n ; cout << fun ( n ); return 0 ; }
this blog contains questions and solutions of codeforces(a competitive programming website) problems. It also contains algorithms and data structures.