Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- n = int(input())
- def primes(n):
- res = []
- nums = [True] * (n + 1)
- for i in range(2, n + 1):
- if nums[i]:
- res.append(i)
- j = i**2
- while i < math.floor(n**0.5) + 1 and j < n + 1:
- nums[j] = False
- j += i
- return res
- res = None
- nums = primes(n)
- s = set()
- for num in nums:
- if num == n - num or n - num in s:
- res = f'{num} {n - num}'
- break
- else:
- s.add(num)
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement