Constant-Time Range Minimum Query
You are given an array of integers. Your task is to answer multiple range minimum queries efficiently.
Input
The first line contains n (1 ≤ n ≤ 100,000), the size of the array.
The second line contains n space-separated integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^9), the array elements.
The third line contains q (1 ≤ q ≤ 100,000), the number of queries.
The next q lines each contain two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ n), asking for the minimum value in the range [l_i, r_i] (1-indexed, inclusive on both ends).
Output
For each query, print the minimum value in the specified range.
Notes
The solution must preprocess the array in O(n log n) time and answer each query in O(1) time.