Interesting Representation solution codechef

Interesting Representation solution codechef

Given a positive integer NN, find two positive integers AA and BB, such that AB=NA−B=N and the number of distinct prime factors of AA and BB are equal. If there exist multiple pairs of values of AA and BB satisfying the given conditions, you can output any one of them.

  • First line will contain TT, number of testcases. Then the testcases follow.
  • Each testcase contains of a single line of input, integer NN.

Output Format

For each testcase, output in a single line two space separated integers AA and BB. If there are multiple answers, you can output any one of them.

  • 1T10001≤T≤1000
  • 1N10161≤N≤1016
  • 1A,B10181≤A,B≤1018


Subtask 1 (100 points): Original constraints



Sample Output 1 

3 2
97 89
1071 936

Leave a Reply

Your email address will not be published. Required fields are marked *