/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 348.0 KiB
#2 Accepted 37ms 1.391 MiB
#3 Accepted 65ms 1.621 MiB
#4 Accepted 67ms 2.27 MiB

Code

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

void solve() {
    ll l,r,x;
    cin >> l >> r >> x;
    if(x >= 0) {
        if(l + x <= r) cout << l + x << ' ' << l << '\n';
        else cout << - 1 << ' ' << - 1 << '\n';  
    } else {
        if(r + x >= l) cout << r + x << ' ' << r << '\n';
        else cout << - 1 << ' ' << - 1 << '\n';  
    }
    return;
}

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int tc = 1;
    cin >> tc;
    for(int kase = 1; kase <= tc; kase++) {
        //cout << "Case " << kase << ": ";
        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:08:03
Judged At
2025-04-06 16:08:03
Judged By
Score
100
Total Time
67ms
Peak Memory
2.27 MiB