SOLVE

LATER

Spidey Mania Strikes Again

Problem

Editorial

Analytics

ItsmeAbhi and Mrinmay_spidey_mania are applying for BharGanao, a startup which aims to put their skill of making android application to good use. For that they need to answer some tests regarding spider-man. Since none of them are capable of doing this on their own, you need to help them solve these tests and prove that their love for spider-man isn't unfounded . They are given an array of elements for each test case and they need to solve ** Q** queries per test case (

** T**, the number of test cases.

For each test case:

The first line contains

For each query output a single integer ** k** in the new line,

*1<=T<=10*

*1<=N<=10^6*

*0<=Ai<=10^9*

*1<=Q<=10^5*

*1<=L<=R<=N*

Explanation

There are 5 elements in the array. {2,3,4,5,2}.

For first query, the elements in range (1,4) are {2,3,4,5}. So the minimum of them is 2 which has index 1. Thus the answer is 1.

For second query, the 2 at index 5 is minimum in the range (2,5), so the answer is 5.

Similarly, for the third query, the 3 at index 3 is minimum in (3,4). So the answer is 3.

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala 2.11.8,
Swift,
Visual Basic

Initializing Code Editor...

{"d1066ef": "/pagelets/suggested-problems/algorithm/segment-tree-2/", "d106731": "/pagelets/recommended-problems/algorithm/segment-tree-2/", "d1066c8": "/pagelets/show-submission/algorithm/segment-tree-2/", "d106707": "/pagelets/problem-author-tester/algorithm/segment-tree-2/", "d10671c": "/pagelets/problems-hint/algorithm/segment-tree-2/"}

{}

realtime.hackerearth.com

80

e2d2d3952ed99d092d9dd02d55fdaf0da73ebb45

58a29e5cae2309f04b28

/realtime/pusher/auth/