QOJ.ac

QOJ

حد الوقت: 10 s حد الذاكرة: 1024 MB مجموع النقاط: 17

#11450. 被遗弃的解

الإحصائيات

有人刚刚赢得了 Code Jam 彩票,我们欠他们 $N$ 个 jamcoin!然而,当我们试图打印一张超大支票时,遇到了一个问题。$N$ 的值是一个整数,其中至少包含一个数字 $4$……而我们超大支票打印机键盘上的 $4$ 键坏了。

幸运的是,我们有一个变通方法:我们将给获奖者发送两张支票,金额分别为正整数 $A$ 和 $B$,使得 $A$ 和 $B$ 都不包含数字 $4$,且 $A + B = N$。请帮助我们找到满足这些条件的任意一对 $A$ 和 $B$。

输入格式

输入的第一行包含测试用例的数量 $T$。接下来有 $T$ 个测试用例;每个测试用例由一行包含一个整数 $N$ 的内容组成。

输出格式

对于每个测试用例,输出一行 Case #x: A B,其中 $x$ 是测试用例编号(从 $1$ 开始),$A$ 和 $B$ 是如上所述的正整数。

保证至少存在一个解。如果存在多个解,你可以输出其中任意一个。(请参阅 FAQ 中“如果一个测试用例有多个正确答案怎么办?”部分。关于多个解的信息在 2019 年竞赛的其余部分中将不会明确说明。)

样例

输入格式 1

3
4
940
4444

输出格式 1

Case #1: 2 2
Case #2: 852 88
Case #3: 667 3777

说明

在样例 1 中,请注意 $A$ 和 $B$ 可以相同。唯一其他可能的答案是 $1$ $3$ 和 $3$ $1$。

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.