Accepted
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int l, r, x;
cin >> l >> r >> x;
if (l + x >= l && l + x <= r) {
cout << l + x << " " << l << "\n";
}
else if (r + x >= l && r + x <= r) {
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 17:40:18
- Judged At
- 2025-04-06 17:40:18
- Judged By
- Score
- 100
- Total Time
- 320ms
- Peak Memory
- 2.352 MiB