insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Check if a given even number can be expressed as the sum of two prime numbers (Goldbach's conjecture verification).

Check if a given even number can be expressed as the sum of two prime numbers (Goldbach's conjecture verification).

Difficulty: Medium

Phase: 6 · Mixed Logical Challenges

XP Reward: 20 XP

Topics: Mixed Logical Challenges, Medium

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Given an even number N (> 2), find two prime numbers p1 and p2 (p1 <= p2) such that p1 + p2 = N. Print in format 'p1 p2'. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: 10

Output: 3 7

Explanation: Sample execution for input 10