/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 40ms 1.43 MiB
#3 Accepted 44ms 1.77 MiB
#4 Accepted 47ms 2.387 MiB

Code

using i64 = long long;
using i128 = __int128;
using u32 = unsigned;
using u64 = unsigned long long;
using f32 = double;
using f64 = long double;

#define uset unordered_set
#define umap unordered_map
#define vi vector<int>
#define vvi vector<vi>
#define vll vector<i64>
#define vvll vector<vll>
#define pii pair<int, int>
#define pll pair<i64, i64>
#define vpii vector<pii>
#define vpll vector<pll>
#define vvpii vector<vpii>
#define vvpll vector<vpll>
#define vz vector<Z>
#define vvz vector<vz>
#define pb push_back
#define pq priority_queue
#define ALL(x) (x).begin(), (x).end()
#define rep(i, x, y) for (int (i) = (x); (i) < (y); (i)++)
#define repr(i, x, y) for (int (i) = (x); (i) > (y); (i)--)
#define YES "YES\n"
#define NO "NO\n"
#define SZ(x) (static_cast<int>(x.size()))


#include <bits/stdc++.h>

using namespace std;

mt19937_64 rng((unsigned) chrono::high_resolution_clock::now().time_since_epoch().count());

void solve() {
    int l, r, x;
    cin >> l >> r >> x;
    int f = 0;
    if (x < 0) {
        f = 1;
        x *= -1;
    }
    if (r - l < x) {
        cout << -1 << " " << -1 << "\n";
    } else {
        if (!f) cout << l + x << " " << l << "\n";
        else cout << l << " " << l + x << "\n";
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;
    while (t--) solve();
}

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