Equal to X

Equal to X

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Time Limit: 1.0 s

Memory Limit: 256.0 MB

Description

You are give 3 integers l,r,x where (l ≤ r)and you need to find two integers p and q such that:

  • l ≤ p ≤ r
  • l ≤ q ≤ r
  • p - q = x

If such integers p and q exist, print them. Otherwise, print -1 -1.
If there are multiple valid pair(p,q) exist, you are allowed to print any of them.

Input

  • The first line contains an integer t (1 ≤ t ≤ \(10^5\)), the number of test cases.
  • For each test case, you are given three integers l, r, and x (1 ≤ l ≤ r ≤ \(10^9\), -\(10^9\) ≤ x ≤ \(10^9\)).

Output

  • For each test case, if such pair exist, print p and q separated by a space, otherwise print -1 -1.

Sample

Input Output
5
10 12 -3
5 20 3
1 10 1
10 12 3
6 14 0
-1 -1
15 12
6 5
-1 -1
10 10

Sample test case explaination:
Second test, We can select p = 15 and q = 12, p - q = 15 - 12 = 3, which is equal to x.

Brain Booster #9

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
9
Start at
2025-04-06 15:30
End at
2025-04-06 18:00
Duration
2.5 hour(s)
Host
Partic.
90