Accepted
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