P9373 "DROI" Round 2 Construction and Modulo

Background

Instead of writing a weak background, it is better to create a higher-quality problem.

Description

For integers $n, k$, if there exist a **non-negative integer** $x$ and a **positive integer** $y$ such that: $$x + y = n\ \land\ x \bmod y =k$$ then we call the ordered pair $(x, y)$ an **excellent split** of $n$ (where $\land$ means **and**). Now given non-negative integers $n, k$, please construct **any** excellent split of $n$, and output the $x$ and $y$ in your construction. In particular, if no such split exists, output `-1`.

Input Format

**This problem has multiple test cases.** The first line contains a positive integer $T$, representing the number of test cases. The next $T$ lines each contain two non-negative integers, $n, k$.

Output Format

Output a total of $T$ lines. The $i$-th line gives the answer for the $i$-th test case.

Explanation/Hint

#### Sample Explanation For the first test case, there is only one possible construction. For the second test case, $(3,10)$ is also a valid construction. For the third test case, it can be proved that no valid construction exists. ------------ #### Constraints **"This problem uses bundled tests."** - $\operatorname{Subtask} 1(20\%)$: $n \leq 10^6$. - $\operatorname{Subtask} 2(40\%)$: $n \leq 10^{12}$. - $\operatorname{Subtask} 3(40\%)$: no special restrictions. For $100\%$ of the testdata: $T \leq 5$, $0 \leq n, k \leq 10^{18}$. Translated by ChatGPT 5