You are given two integer arrays $$$a(a_{0},a_{1},....,a_{n-1})$$$ containing $$$n$$$ elements, $$$b(b_{0},b_{1},....,b_{n-1})$$$ containing $$$n$$$ elements and an integer $$$k$$$.
You are allowed to do the following popular segment tree Operation on array $$$a$$$.
Find the minimum number of Operations required to change $$$a$$$ to $$$b$$$ or report if it is impossible to do.
Note that, $$$x\%y$$$ is the remainder when $$$y$$$ divides $$$x$$$. i.e., $$$(10\%4) = 2$$$, $$$(-5\%4) = 3$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^5$$$). The description of the test cases follows.
The first line of test case contains two integers $$$n,k$$$ ($$$1 \le n \le 2 \cdot 10^6$$$, $$$0 \le k \le ⌊\frac{n-1}{2}⌋$$$) — the length of the given arrays and an integer.
The second line of each test case contains $$$n$$$ space separated integers $$$a_{i}$$$ ($$$1 \le a_{i} \le 10^{12}$$$).
The third line of each test case contains $$$n$$$ space separated integers $$$b_{i}$$$ ($$$1 \le b_{i} \le 10^{12}$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \cdot 10^6$$$.
For each test case, print a single integer — the minimum number of Operations required to change $$$a$$$ to $$$b$$$ or $$$"-1"$$$(without quotes) if it is impossible to change.
34 11 4 3 217 14 25 26 21 1 1 1 1 11 49 5 29 9 135 21 2 3 9 112 4 6 18 22
4 5 -1
In the first test case,
Hence, the total operations required are $$$4$$$.
| Name |
|---|


