Due to I was very boring, I generate $$$n$$$ arrays, labeled from $$$1$$$ to $$$n$$$. And then I will give $$$q$$$ queries.
In each queries:
It is attention that, each query is independent. It means that the array merging operation of a single query will not affect other queries.
The first line contains a single interger $$$n(1 \leq n \leq 10^5)$$$, denoting the number of arrays.
The next $$$n$$$ lines, for each line:
The $$$n + 1$$$ line contains a single integer $$$q(1 \leq q \leq 10^5)$$$, denoting the number of queriyes.
The next $$$q$$$ liens, for each line:
It is guaranteed that $$$\sum\limits_{i = 1}^{n} m_i \leq 10^5$$$ and $$$\sum\limits_{i = 1}^{q} l_i \leq 10^5$$$.
For each query, you should print the $$$k$$$-$$$th$$$ smallest element in the combined array in a single line.
5 1 1 2 2 3 3 5 10 6 4 4 58 2 1 5 1000000000 9 8 4 5 5 1 2 2 2 2 3 3 3 3 4 5 11 4 5 4 3 2 1 5 1 2 5 4 3 7
3 5 58 1 4
| Название |
|---|


