/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 32ms 1.242 MiB
#3 Accepted 35ms 1.562 MiB
#4 Accepted 44ms 2.27 MiB

Code

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define int long long
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (int i = 0; i < n; i++)
#define trace(x) cerr << #x << ": " << x << '\n'
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--)
    {
        int l, r, x;
        cin >> l >> r >> x;
        if (abs(r - l) < abs(x))
        {
            cout << "-1 -1\n";
        }
        else if (x < 0)
        {
            cout << r - abs(x) << " " << r << '\n';
        }
        else
            cout << l + abs(x) << " " << l << "\n";
    }
}

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 15:34:47
Judged At
2025-04-06 15:34:47
Judged By
Score
100
Total Time
44ms
Peak Memory
2.27 MiB