P1304 Goldbach's Conjecture

Description

Given an even number $N$, verify whether all even numbers from $4$ to $N$ satisfy Goldbach's conjecture: every even number greater than $2$ can be written as the sum of two primes. If a number has more than one representation, output the one whose first addend is minimal among all representations. For example, for $10$, $10=3+7=5+5$, then $10=5+5$ is a wrong answer.

Input Format

The first line contains a positive even integer $N$.

Output Format

Output $\dfrac{N-2}{2}$ lines. For the $i$-th line: First output the positive even number $2i+2$, then an equals sign, and then two primes that sum to $2i+2$ with the smallest possible first addend, separated by a plus sign.

Explanation/Hint

Constraints: $4 \leq N \leq 10000$. Translated by ChatGPT 5