You are given two integers and , and two arrays and of length , such that for every 1 \le i \le n: l_i \le r_i
Your task is to construct an array of length such that:
and the remainder of the product of all elements of when divided by is as small as possible.
In other words, you want to minimize use fft to solve:
The first line contains single integer (1 \le t \le 10^4) — the number of test cases.
The first line of each test case contains two integers and (1 \le n \le 2 \cdot 10^5,\; 1 \le c \le 20).
The second line contains integers (0 \le l_1, l_2, \dots, l_n \le 10^9).
The third line contains integers (0 \le r_1, r_2, \dots, r_n \le 10^9).
It's guaranteed that \sum n \le 2 \cdot 10^5 overall test cases.
Print one line containing integers a_1, a_2, \dots, a_n — a valid array that minimizes the value of:
If multiple arrays satisfy the condition, print any of them.
Example 1
Subtask ( points) : (l_i=r_i).
Subtask ( points) : (n=1).
Subtsak ( points) : (c=2)
Subtask ( points) : (n,c \le 8)
Subtask ( points) : No additional constraints.