The first line contains an positive integer $T$, represents there are $T$ test cases.
For each test case:
The first line contains two positive integers $n$ and $m$.
The second line contains $n$ non-negative integers, represent $a_1,a_2,\cdots,a_n$.
The next $m$ lines, the $i$-th line contains two non-negative integers $x$ and $y$, represent the $i$-th called function is $funct(x,y)$.
There is a blank between each integer with no other extra space in one line.
$1\leq T\leq 1000,2\leq n\leq 2\cdot10^4,1\leq m\leq 2\cdot10^4,0\leq a_i,y\leq 10^9,1\leq x\leq n,1\leq\sum{n},\sum{m}\leq10^5$