#K44512. Find Two Integers with Given GCD

    ID: 27548 Type: Default 1000ms 256MiB

Find Two Integers with Given GCD

Find Two Integers with Given GCD

You are given two integers n and k. Your task is to find two integers a and b such that:

$$a+b=n$$ and $$\gcd(a,b)=k$$

It is guaranteed that a solution exists for the given input values and that n is at least 2k. Use the fact that one valid solution is to take a=k and b=n-k, which meets the requirements.

Read the input from standard input and output the answer to standard output.

inputFormat

The first line of input contains a single integer T, representing the number of test cases.

Each of the following T lines contains two integers n and k, separated by a space.

Constraints: It is guaranteed that a solution exists, and typically n is divisible by k with n ≥ 2k.

outputFormat

For each test case, output a single line with two integers a and b separated by a space such that a+b=n and \(\gcd(a,b)=k\).

## sample
3
10 2
14 7
100 20
2 8

7 7 20 80

</p>