CF472A.Design Tutorial: Learn from Math

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.

For example, there is a statement called the "Goldbach's conjecture". It says: "each even number no less than four can be expressed as the sum of two primes". Let's modify it. How about a statement like that: "each integer no less than 12 can be expressed as the sum of two composite numbers." Not like the Goldbach's conjecture, I can prove this theorem.

You are given an integer n no less than 12, express it as a sum of two composite numbers.

构造任务的一种方法是向数学学习。你可以生成一些随机的数学命题,或对某些定理进行修改以得到新结论,并基于此构建一道新题目。

例如,有一个著名的命题叫做“哥德巴赫猜想”,其内容为:“任一大于等于 4 的偶数均可表示为两个素数之和”。我们来对它稍作修改:考虑如下命题——“任一大于等于 12 的整数均可表示为两个合数之和”。与哥德巴赫猜想不同,这个命题我可以证明。

现给你一个不小于 12 的整数 $ n $,请将它表示为两个合数之和。

输入格式

The only line contains an integer n (12 ≤ n ≤ 106).

唯一一行包含一个整数 nn(12 ≤ n ≤ 10612 \leq n \leq 10^6)。

输出格式

Output two composite integers x and y (1 < x, y < n) such that x + y = n. If there are multiple solutions, you can output any of them.

输出两个合数 xx 和 yy(满足 1<x,y<n1 < x, y < n),使得 x+y=nx + y = n。若存在多组解,输出任意一组即可。

输入输出样例

  • 输入#1

    12

    输出#1

    4 8
  • 输入#2

    15

    输出#2

    6 9
  • 输入#3

    23

    输出#3

    8 15
  • 输入#4

    1000000

    输出#4

    500000 500000

说明/提示

In the first example, 12 = 4 + 8 and both 4, 8 are composite numbers. You can output "6 6" or "8 4" as well.

In the second example, 15 = 6 + 9. Note that you can't output "1 14" because 1 is not a composite number.

在第一个例子中,12=4+812 = 4 + 8,且 44 和 88 均为合数。你也可以输出 “6 6” 或 “8 4”。

在第二个例子中,15=6+915 = 6 + 9。注意,你不能输出 “1 14”,因为 11 不是合数。

输入解题思路,AI测评打分。不知道怎么写?

首页