/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Runtime Error 35ms 1.113 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define optimize() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
int main() {
    optimize();

    int t;
    cin >> t;
    while(t--){
        long long l,r,x;
        cin >> l >> r >> x;
        if(x==0){
        long long m=min(l,r);
            cout << m << " " << m << endl;
        }else if(x<0){
            cout << -1 << " " << -1 << endl;
        }else if(l>=x && x<=r){
            long long maximum=max(l,r);
            long long minimum=min(l,r);
            long long ans=maximum-minimum;
            cout << ans << " " << ans-x << endl;
        }else if(l==x && x<=r){
            cout << -1 << " " << -1 << endl;

    }
}
    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:10:57
Judged At
2025-04-06 17:10:57
Judged By
Score
0
Total Time
35ms
Peak Memory
1.113 MiB