Initial commit
This commit is contained in:
parent
8b7c08e3a5
commit
d644e8a379
23
486A Calculating Function/486A.cpp
Normal file
23
486A Calculating Function/486A.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
using ll = long long;
|
||||||
|
|
||||||
|
void solve()
|
||||||
|
{
|
||||||
|
ll n,sum=0;
|
||||||
|
cin>>n;
|
||||||
|
if(n%2==0) sum=n/2;
|
||||||
|
else sum=-(n/2+1);
|
||||||
|
cout<<sum<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
ios_base::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
|
||||||
|
int TC = 1;
|
||||||
|
//cin >> TC;
|
||||||
|
//cin.ignore();
|
||||||
|
while (TC--) solve();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user