{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given an array of integers. You will be given queries in form (i,j,k). You have to answer the following question:\n\u003c/p\u003e\n\u003cp\u003e\nwhat will be the k\u0027th integer if the subarray a\u003csub\u003ei\u003c/sub\u003e,a\u003csub\u003ei+1\u003c/sub\u003e,...,a\u003csub\u003ej\u003c/sub\u003e was sorted in non decreasing order? \n\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cul\u003e\n\u003cli\u003eLine 1: two integers n (1 \u0026le; n \u0026le; 10\u003csup\u003e5\u003c/sup\u003e) and q (1 \u0026le; q \u0026le; 5000).\u003c/li\u003e\n\u003cli\u003eLine 2: n integers a\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003en\u003c/sub\u003e\u0026nbsp;(-10\u003csup\u003e9\u003c/sup\u003e \u0026le; a\u003csub\u003ei\u003c/sub\u003e\u0026nbsp;\u0026le; 10\u003csup\u003e9\u003c/sup\u003e).\u003c/li\u003e\n\u003cli\u003eNext q lines will contain three integers i, j, k (1 \u0026le; i \u0026le; j \u0026le; n,1 \u0026le; k \u0026le; j - i + 1).\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint the ans of the queries in separate lines\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cpre\u003eSAMPLE INPUT\u003c/pre\u003e\n\u003cpre\u003e7 3\n1 5 2 6 3 7 4\n2 5 3\n4 4 1\n1 7 3\n\n\u003c/pre\u003e\n\u003cpre\u003eSAMPLE OUTPUT\n5\n6\n3\u003c/pre\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e"}}]}