Your huge terrarium has a big glass panel. You have several stickers that you can paste onto the glass.
You have $$$n$$$ decorative stickers. For each sticker $$$i$$$ you are given:
You also have $$$m$$$ bottles of UV protecting cream. For each bottle $$$i$$$:
Example clarification: If you choose bottles 1 and 2, and decorative stickers 2, 4, and 6, then the following must hold: $$$au[1] + au[2] \lt = area[2] + area[4] + area[6]$$$.
Your scientists determine the following:
Find the maximum total beauty you can obtain. If it is impossible to keep the plants alive, output -1.
The first line contains the integer $$$t$$$ $$$(1 \le t \le 60)$$$, the number of testcases. For each test case we have:
The first line contains five integers $$$n, m, I, V, U$$$.
Then $$$n$$$ lines follow. The $$$i$$$-th of these lines contains four integers: $$$b[i], ir[i], vis[i], area[i]$$$.
Then $$$m$$$ lines follow. The $$$i$$$-th line contains two integers: $$$u[i]$$$, $$$au[i]$$$.
Constraints
Let $$$A_1 = \sum_{i=1}^n area[i]$$$ and $$$A_2 = \sum_{i=1}^n au[i]$$$
Additionally the following hold:
Print a single integer: the maximum achievable total beauty. If it is impossible to keep the plants alive, print -1.
23 3 50 3 53 2 1 24 3 2 35 4 10 47 18 110 1003 2 4 4 33 2 1 22 1 2 24 2 2 32 23 3
7 7
In the first example test case
The second example test case can also be reasoned out to show that 7 is the best we can do.