Accepted
Code
// Author: Shohidur Rahman
#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main() {
fast;
int t;
cin >> t;
while(t--){
ll l,r,x;
cin >> l >> r >> x;
ll max=r-l;
ll min=l-r;
if(x<=max && x>=min){
if(r-x>=l && r-x<=r){
cout << r << " "<< r-x << "\n";
}
else{
cout << r+x << " " << r << "\n";
}
}
else cout << "-1 -1\n";
}
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:59:39
- Judged At
- 2025-04-06 16:59:39
- Judged By
- Score
- 100
- Total Time
- 57ms
- Peak Memory
- 2.52 MiB