/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 35ms 1.27 MiB
#3 Accepted 39ms 1.77 MiB
#4 Accepted 66ms 2.348 MiB

Code

/*
 * Name : Md. Fahmidur Rahman Nafi
 * Date : 2025-04-06   Time : 20:34:27
 */

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
#define lcm(a,b) ((a*b)/__gcd(a,b))
#define debug(x) cout << "Debug : " << x << endl;
const double PI = 2 * acos(0.0);
const int MOD = 1000000007;

void solve(){
    ll l, r, x;
    cin >> l >> r >> x;

    if (x >= 0){
        if (l + x <= r){
            cout << l + x << ' ' << l << endl;
            return;
        }
    }
    else{
        if(r + x >= l){
            cout << r + x << ' ' << r << endl;
            return;
        }
    }
    cout << -1 << ' ' << -1 << endl;
}

int main(){
    ios_base::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:48:17
Judged At
2025-04-06 15:48:17
Judged By
Score
100
Total Time
66ms
Peak Memory
2.348 MiB