← All problemsSign in

Max Query

Himanshu is a pr0 at maths. Hence, he was given the responsibility of making a good question for Prosort. He eventually decided on the following problem: Given a sequence of $N$ integers $A_1,A_2,...,A_N$, answer $Q$ queries. Each query is described by $3$ integers $L$, $R$, and $K$, meaning report the maximum among the multiples of $K$ in the sub-array from $L$ to $R$ (both inclusive). If no mu

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