Goldbach
Time Limit : 1 Second
Memory Limit : 512 MB
Submission: 88
Solved: 29
- Description
It is still unproven that whether an even integer n can be the sum of tow odd prime numbers.
Example:
14 = 3 + 11.
22 = 3 + 19 = 5 + 17 = 11 + 11.
- Input
The input will contain one or more test cases.
Each test case consists of one even integer n (6 <= n <= 1000000).
Input will be terminated by a value of 0 for n.
- Output
For each test case, you should print one line:
n = a + b, where a and b are odd primes.
If there is more than one pair of a and b adding up to n,
output the pair where b - a is maxmized. If there is no such pair, print a
line saying "No answer".
- sample input
-
14 22 0
- sample output
-
14 = 3 + 11 22 = 3 + 19
- hint
- source