Back
Close

Play With Prime

Statement

 Goal

Given an even number greater than 2, print two prime numbers whose sum is equal to the given number. As there may be several combinations possible, print the pair whose first number is the lowest possible.
A solution always exists according to Goldbach’s conjecture.
Input
An EVEN Number n
Output
Two space-separated integers which are the required prime numbers
Constraints
2<n<=10^9
Example
Input
74
Output
3 71

Game modes
FastestShortestReverse

Test cases
74 Test
Input
74
Output
3 71

1024 Validator
Input
1024
Output
3 1021

66 Test
Input
66
Output
5 61

9990 Validator
Input
9990
Output
17 9973

8272642 Test
Input
8272642
Output
29 8272613

9163476 Validator
Input
9163476
Output
13 9163463

222222 Test
Input
222222
Output
23 222199

12345678 Validator
Input
12345678
Output
31 12345647

Solution language

Solution

Stub generator input