Universal Cup Judging System

Universal Cup

Limite de temps : 4 s Limite de mémoire : 512 MB Points totaux : 100
Statistiques

如果一个正整数的十进制表示由同一个数字重复组成,则称其为“重数”(repdigit)。例如,1、666、4444 和 999999 是重数,而 0、44244、50216 和 787788 则不是。

给定一个正整数 $n$。已知 $n$ 可以表示为 $n = a + b$,其中 $a$ 和 $b$ 均为重数。请找到任意一组这样的表示。

输入格式

每个测试点包含多个测试用例。第一行包含测试用例的数量 $t$ ($1 \le t \le 10^4$)。

接下来是各测试用例的描述。

每个测试用例仅包含一行,为一个不含前导零的整数 $n$ ($2 \le n < 10^{4000}$)。保证 $n$ 可以表示为 $n = a + b$,其中 $a$ 和 $b$ 均为重数。

保证所有测试用例中 $n$ 的总位数不超过 $10^5$。

输出格式

对于每个测试用例,输出两个整数 $a$ 和 $b$,使得 $n = a + b$ 且 $a$ 和 $b$ 均为重数。

如果存在多种解,输出其中任意一种即可。

样例

输入 1

6
2
786
1332
89110
2333333
10000000000000000000000000001

输出 1

1 1
777 9
333 999
88888 222
2222222 111111
9999999999999999999999999999 2

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.