← All problemsSign in

Arithmetic Progression

Given an array A (A0, A1, A2,..., AN-1) of length N. You need to answer Q queries. Each query is described by 3 values L, R, D. For each of the query you need to print the sum :- AL + AL+D + AL+2*D + ... + AL+i*D such that L + i * D ≤ R. Input The first line of input contains an integer N denoting the number of elements in the array A. The next line contains N space separated integers A0, A1

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