{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n 给你N个数和M个询问(i,j,k),求区间[i,j]的第k大值\n \u003cbr\u003e其中N\u003c\u003d100000,M\u003c\u003d5000,每个元素大小在32位整型范围内\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The first line of the input file contains n --- the size of the array, and m --- the number of questions to answer (1 \u0026lt;\u003d n \u0026lt;\u003d 100 000, 1 \u0026lt;\u003d m \u0026lt;\u003d 5 000). \n \u003cbr\u003eThe second line contains n different integer numbers not exceeding 10\n \u003csup\u003e9\u003c/sup\u003e by their absolute values --- the array for which the answers should be given. \n \u003cbr\u003eThe following m lines contain question descriptions, each description consists of three numbers: i, j, and k (1 \u0026lt;\u003d i \u0026lt;\u003d j \u0026lt;\u003d n, 1 \u0026lt;\u003d k \u0026lt;\u003d j - i + 1) and represents the question Q(i, j, k). \n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For each question output the answer to it --- the k-th number in sorted a[i...j] segment. \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e7 3\n1 5 2 6 3 7 4\n2 5 3\n4 4 1\n1 7 3\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e5\n6\n3\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n This problem has huge input,so please use c-style input(scanf,printf),or you may got time limit exceed.\n \u003c/div\u003e"}}]}