Only there wouldn't be simple ones
Very hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a natural number ( N ), your task is to decompose it into the smallest number of non-prime numbers such that their sum equals ( N ). If there are multiple valid decompositions, choose the one where the sequence of numbers has the maximum sum of absolute differences between consecutive numbers, and present this sequence in non-increasing order.
Constraints
( 1 \leq N \leq 10^{12} ).
Input Format
A single line containing the number ( N ).
Output Format
A single line containing the numbers from the decomposition, in non-increasing order, separated by spaces. This should be the only decomposition that meets the problem's criteria.
Note
If ( N ) itself is a non-prime number, it serves as the decomposition, and no further breakdown is necessary.
Submissions 74