Wrong Answer
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;
if(x == 0) {
cout << l << " " << l << "\n";
} else if(l + x >= l && l + x <= r) {
cout << l + x << " " << l << "\n";
} else if(r - x >= l && r - x <= r) {
cout << r << " " << r - x << "\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:39:41
- Judged At
- 2025-04-06 16:39:41
- Judged By
- Score
- 1
- Total Time
- 35ms
- Peak Memory
- 1.312 MiB