Pretty Average Primes


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Python

Problem Description

Given a positive integer N, please find two prime numbers A and B such that N is exactly the average of A and B, i.e., N = (A + B)/2.

Note: A and B can be equal.

Input Format

  • The first line contains an integer T, indicating the number of test cases.
  • Each test case consists of one line containing an integer N.

Output Format

For each test case, output one line containing two prime numbers A and B.

It is guaranteed that a solution exists. If there are multiple solutions, output any valid one.

Constraints

  • 1 ≤ T ≤ 1000
  • 4 ≤ N ≤ 106

Sample Input

4
8
4
7
21

Sample Output

3 13
5 3
7 7
13 29

Comments

There are no comments at the moment.