The first line contains a number $T(T \le 5)$, the number of testcases.
For each testcase, the first line contains a number $n (n \le 200)$
On the second line , there are n numbers $P_i(1 \le i \le n)$ indicating the number of pilots needed on that day
On the third line , 3 numbers , $m(1 \le m \le 5) , P , Q$
On the following m lines , each line has two numbers: $S_i$ , $T_i$
all input data $x$ satisfy $x\in[0 , 200]$