The first line contains a single integer $T$ ($1 \leq T \leq 100$), the number of test cases. For each test case:
The first line contains two integers $n$ and $H$ ($1 \leq n \leq 18$, $1\leq H\leq 10^{18}$), denoting the number of skills and the HP of the boss.
For each skill, the first line contains two integers $t_i$ and $len_i$ ($1 \leq t_i,len_i\leq 100\,000$), the second line contains $len_i$ integers $d_{i,0},d_{i,1},\dots,d_{i,len_i-1}$ ($1\leq d_{i,j}\leq 10^9$).
It is guaranteed that the sum of all $len_i$ is at most $3\,000\,000$, and there are at most $5$ cases such that $n>10$.