Unhappy Sum
Limits: 1 sec., 256 MiB
This statement was translated automatically from Ukrainian.
It is well known that a lucky number is a positive integer whose decimal representation contains only fours and sevens. For example, the numbers 4, 7, 47, 7777, and 4744474 are lucky.
On the other hand, all other numbers are considered unhappy.
You are given a number \(n\) — represent it as a sum of two unhappy numbers.
Input
The single line contains a single integer \(n\).
Output
Print two positive integer unhappy numbers \(x\) and \(y\) separated by a space, such that \(x + y = n\).
Constraints
\(2 \le n \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 | 2 2 |
| Input (stdin) | Output (stdout) |
|---|---|
| 8 | 5 3 |
Source: The Algo Battles 2025 - Етап 4
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|