C. Butler's Tea
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
3 3
1 2 3
5 11 8
3 3
3 1 1
7 6 5
Output
2
3