Given an array, answer queries: "What is the -th smallest element in subarray ?" Example: Query : 3rd smallest in is .
You're solving the range quantile problem. Common in database systems for percentile queries. Note: LeetCode has related problems, but this specific online query version often appears in competitive programming.