There are multiple cases.(At MOST $5$)
For each case:
The first line contains an integer $N(1 \leq N \leq 30000)$.
The following line contains an integer $K(2 \leq K \leq 2*N)$,WLD's lucky number.K is odd.
The following line contains $N$ integers $a1,a2,...,aN(1 \leq ai \leq N)$.
The following line contains an integer $M(1 \leq M \leq 30000)$,the sum of the questions WLD has to answer.
The following $M$ lines,the i-th line contains $4$ numbers $Li,Ri,Ui,Vi(1 \leq Li \leq Ri < Ui \leq Vi \leq N)$,describing the i-th question the stranger asks.