← All problemsSign in

Queries

Consider an n-integer sequence, A={a0,a1,...,an-1}. We perform a query on A by using an integer,d , to calculate the result of the following equation: min(max aj) 0≤ in , i≤ j i+d Given A and q queries (each query consists of an d integer, ), print the result of each query on a new line. Input Format: The first line consists of two space-separated integers describing the respective values of n

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start