The first line of input contains one integer $T\ (1\le T\le 10)$, indicating the number of test cases.
For each test case, the first line contains two integers $n,m\ (1\le n, m\le 2\times 10^5)$, indicating the number of creatures and the number of schemas of granting ability, respectively.
The second line contains $n$ integers $a_1,a_2,\ldots ,a_n\ (1\le a_i\le 10^9)$, indicating the ability value of each creature.
For the next $m$ lines, the $i\ (1\le i\le m)$-th line contains two integers $x,y\ (1\le x\le y\le n)$, indicating the $i$-th schema.
It is promised that for all test cases, $\sum n\le 3\times 10^5,\sum m\le 3\times 10^5$.