/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 38ms 1.363 MiB
#3 Accepted 43ms 1.77 MiB
#4 Accepted 46ms 2.449 MiB

Code

#include <bits/stdc++.h>
#define ll long long int
#define N "\n"
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin >> t;
    while (t--)
    {
        ll l,r,x;
        cin>>l>>r>>x;
        if(r-l<abs(x)){
            cout<<-1<<" "<<-1<<N;
            continue;
        }
        if(x<0){
            cout<<l<<" "<<l+abs(x)<<N;
            continue;
        }
        cout<<l+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:43:12
Judged At
2025-04-06 15:43:12
Judged By
Score
100
Total Time
46ms
Peak Memory
2.449 MiB