First line contains an integer T, which indicates the number of test cases.
Every test case begins with three integers $N$, $K$ and $L$, which is the number of known characters, the character set size of the original string and the length of the original string.
Then $N$ lines follow, the $i^{th}$ line contains two integers $p_i$ and $v_i$, means the position and value of $i^{th}$ known character.
Limits
$1 \leq T \leq 100$.
$0 \leq N \leq 2000$.
$1 \leq K \leq 10^9$.
$max(1, N) \leq L \leq 10^9$.
$0 \leq p_i < p_{i+1} <L$.
$0 \leq v_i < K$
For 90\% of the use cases, $N \leq 10$ holds.