/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 37ms 1.27 MiB
#3 Accepted 56ms 1.59 MiB
#4 Accepted 48ms 2.52 MiB

Code

/*Starting with the name of almighty ALLAH*/
/*Solved by 'Nazmul'*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define FAST_IO              \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
bool com(int a, int b) { return a > b ? true : false; }
ll power(ll base, ll exp)
{
    ll res = 1;
    base %= MOD;
    while (exp > 0)
    {
        if (exp % 2 == 1)
            res = (res * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return res;
}

void solve()
{
    int a, b, x;
    cin >> a >> b >> x;
    if (abs(a - b) < abs(x))
        cout << -1 << " " << -1 << endl;
    else
    {
        if (x < 0)
            cout << (b - abs(x)) << " " << b << endl;
        else
            cout << b << " " << (b - x) << endl;
    }
    return;
}

int main()
{
    FAST_IO
    int t = 1;
    cin >> t;
    while (t--)
        solve();
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1186 Equal to X
Contest
Brain Booster #9
Language
C++17 (G++ 13.2.0)
Submit At
2025-04-06 16:09:38
Judged At
2025-04-06 16:09:38
Judged By
Score
100
Total Time
56ms
Peak Memory
2.52 MiB