/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 282ms 1.352 MiB
#3 Accepted 324ms 1.672 MiB
#4 Accepted 303ms 2.48 MiB

Code

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


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


int main(){
    int t;  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:02:32
Judged At
2025-04-06 16:02:32
Judged By
Score
100
Total Time
324ms
Peak Memory
2.48 MiB