Universal Cup Judging System

Universal Cup

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓
Estadísticas

众所周知,对于正整数 $a, b$ 和 $n \ge 2$,$(a + b)^n$ 永远不等于 $a^n + b^n$。真的是这样吗?再仔细看看。

给定一个整数 $n \ge 2$,你需要找到正整数 $a$ 和 $b$,使得 $(a + b)^n$ 等于 $a^n + b^n$,其中每个符号的含义均与 C++ 中的解释一致,包括运算符优先级。换句话说,你需要找到 $a$ 和 $b$ 使得:

$$(a + b) \oplus n = a \oplus (n + b) \oplus n$$

成立,其中 $\oplus$ 表示按位异或运算。

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 10^5$),表示测试用例的数量。接下来是 $t$ 个测试用例。

每个测试用例包含一个整数 $n$ ($2 \le n < 2^{60}$)。

输出格式

对于每个测试用例,按以下要求在一行内输出答案:

  • 如果没有解,输出 $-1$。

  • 否则,输出正整数 $a$ 和 $b$ ($1 \le a, b < 2^{60}$),使得题目中的等式成立。在题目给定的约束条件下,可以证明如果存在解,则一定存在满足 $a, b < 2^{60}$ 的解。如果存在多个解,你可以输出其中任意一个。

样例

输入格式 1

5
2
3
6
10
18

输出格式 1

1 1
-1
3 5
7 3
11 39

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.