The input contains multiple test cases.
For each test case:
The first line contains one positive integer $n$, satisfying $1 \leq n \leq 10^6$.
The second line contains $n$ positive integers $l_1, l_2, \cdots, l_n$, satisfying $1 \leq l_i \leq i$ for each $1 \leq i \leq n$.
The third line contains $n$ positive integers $r_1, r_2, \cdots, r_n$, satisfying $i \leq r_i \leq n$ for each $1 \leq i \leq n$.
It's guaranteed that the sum of $n$ in all test cases is not larger than $3 \cdot 10^6$.
Warm Tips for C/C++: input data is so large (about 38 MiB) that we recommend to use
fread() for buffering friendly.
size_t fread(void *buffer, size_t size, size_t count, FILE *stream); // reads an array of count elements, each one with a size of size bytes, from the stream and stores them in the block of memory specified by buffer; the total number of elements successfully read is returned.