#K34347. Taco Pair Construction Problem

    ID: 25289 Type: Default 1000ms 256MiB

Taco Pair Construction Problem

Taco Pair Construction Problem

You are given a positive integer \( n \) and an integer \( k \). Your task is to form \( k \) pairs of integers \( (a_i, b_i) \) such that:

  • \( a_i + b_i = n \)
  • According to the examples, the product condition is implicitly satisfied by taking \( a_i = i \) and \( b_i = n-i \) for \( i = 1, 2, \ldots, k \).

Note: Although the problem statement mentions the constraint \( a_i \times b_i \leq \frac{n}{2} \), the sample test cases indicate that the desired output is obtained by simply choosing \( a_i = i \) and \( b_i = n-i \) for \( i=1 \) to \( k \). Use this construction to produce the required pairs.

inputFormat

The input is read from standard input (stdin) and has the following format:

T
n_1 k_1
n_2 k_2
... 
n_T k_T

Here, \( T \) is the number of test cases. Each test case consists of two integers: \( n \) and \( k \), where \( n \) is the sum target for each pair and \( k \) is the required number of pairs.

outputFormat

For each test case, output exactly \( k \) lines. Each line should contain two space-separated integers \( a_i \) and \( b_i \) corresponding to a valid pair for that test case. The pairs for consecutive test cases immediately follow each other without any blank lines.

## sample
2
10 3
15 4
1 9

2 8 3 7 1 14 2 13 3 12 4 11

</p>