D. 「一本通 6.2 练习 3」Goldbach's Conjecture

    Type: Default 1000ms 512MiB

「一本通 6.2 练习 3」Goldbach's Conjecture

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

原题来自:Ulm Local,题面详见:POJ 2262

哥德巴赫猜想:任何大于 44 的偶数都可以拆成两个奇素数之和。 比如:

$$\begin{align} 8&= 3 + 5\\ 20&= 3 + 17 = 7 + 13\\ 42&= 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23 \end{align}$$

你的任务是:验证小于 10610^6 的数满足哥德巴赫猜想。

输入格式

多组数据,每组数据一个 nn

读入以 00 结束。

输出格式

对于每组数据,输出形如 n=a+bn = a + b,其中 a,ba,b 是奇素数。若有多组满足条件的 a,ba,b,输出 bab-a 最大的一组。
若无解,输出 Goldbach's conjecture is wrong.

样例

8
20
42
0
8 = 3 + 5
20 = 3 + 17
42 = 5 + 37

数据范围与提示

对于全部数据,6n1066\le n\le 10^6