Given an array A of length n, an integer k, and q queries: \(Q_1,Q_2,...,Q_q\), each query contains a single integer x.
For each query, you please print \(max(A_x,A_{x+1},...,A_{x+k-1})\) in a single line
Given an array A of length n, an integer k, and q queries: \(Q_1,Q_2,...,Q_q\), each query contains a single integer x.
For each query, you please print \(max(A_x,A_{x+1},...,A_{x+k-1})\) in a single line
The first line of input contains three integers \(n(1 \leq n \leq 1000000), k(1 \leq k \leq n), q(1 \leq q \leq 1000000)\).
The second line of input contains n integers, \(A_1,A_2,...,A_n\), each of them is between \(1\) and \(10^9\)
The third line contains q integers, \(Q_1,Q_2,...,Q_q\), it's guranted that for each \(1 \leq i \leq q, 1\leq Q_i \leq n-k+1\)
For each query \(Q_i(1 \leq i \leq q)\), print \(max(A_{Q_i},A_{Q_{i}+1},...,A_{Q_{i}+k-1})\) in a single line
5 2 2
1 2 3 2 1
1 3
2
3