The first line contains an integer--- the number of test cases.
For each test case, the first line contains an integer--- the number of rectangles.
Thenlines follow, each line contains
integers
--- the lower left corner
and upper right corner
.
The next line containsintegers
--- the weight of the
-th rectangle.
It is guaranteed thatover all test cases.
For each test case, output an integer in one line --- the maximum value of. If all rectangles overlap each other, output
.