/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 32ms 1.395 MiB
#3 Accepted 36ms 1.711 MiB
#4 Accepted 43ms 2.496 MiB

Code

#include<bits/stdc++.h>
#define ll                  long long
#define nl                  '\n'
#define F                   first
#define S                   second
#define all(a)              (a.begin()),(a.end())
#define UNIQUE(X)           (X).erase(unique(all(X)),(X).end())
#define SORT_UNIQUE(c)      (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define ms(a,b)             memset(a, b, sizeof(a))
#define Input               freopen("in.txt","r",stdin)
#define Output              freopen("out.txt","w",stdout)
#define MOD                 1000000007
using namespace std;


const int N = 2e5 + 5;

void Solve(int t)
{
	ll l, r, x;
	cin >> l >> r >> x;
	ll p, q;
	p = l;
	q = p - x;
	if (q >= l && q <= r) {
		cout << p << ' ' << q << nl;
		return ;
	}
	p = r;
	q = p - x;
	if (q >= l && q <= r) {
		cout << p << ' ' << q << nl;
		return ;
	}
	cout << "-1 -1\n";
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t, T = 1;
	cin >> T;
	for (t = 1; t <= T; t++)
		Solve(t);
	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 15:33:49
Judged At
2025-04-06 15:33:49
Judged By
Score
100
Total Time
43ms
Peak Memory
2.496 MiB