Binomial coefficients 2#319

Binomial coefficients 2

1 second
128 megabytes
Medium

You are given two non-negative integers and . Find the prime factorization of the binomial coefficient C_n^k.

Input

The first line contains the number of tests t~(t \le 10). Each of the following lines represents a separate test case and contains two integers and k~(0 \le n \le 10^5, 0 \le k \le n).

Output

Print lines, each of which should contain the prime factorization of C_n^k.

The prime factorization of a positive integer must be printed as follows.

If n = 1, print .

Otherwise, let

n = p_1^{a_1} \times \ldots \times p_d^{a_d},

where p_1, \ldots, p_d are the distinct prime divisors of in increasing order, and a_1, \ldots, a_d are their corresponding positive exponents.

Then print the expression in the format

p_1~\text{\^{}}~ a_1 * p_2~\text{\^{}}~ a_2 * \ldots * p_d~\text{\^{}}~ a_d

The exponent a_i should be omitted if a_i = 1.

Examples

Example 1

Loading
Loading