Grace has n numbers. They are a1……an . Let M = sqrt(n), meaning the biggest integer which is less than or equal to the square root of n. And there are n queries. For each query, there are two integers x and y. You need to answer the M-th biggest number among ax, ax+y……(x + ky <= n) . If the number of the elements is less than M, please output -1.