Problem A 1594
Problem Link: A. Consecutive Sum Riddle, 800 RATED - Codeforces Round 747 (Div. 2)
Approach
Sum of negative of n-1
to +n
is equals to n
.
Code Implementation
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
cout << -(n - 1) << " " << n << endl;
}
return 0;
}