← All problemsSign in

Sequence Summation

Problem Statement For a sequence a1, a2, a3 ..... an , it is known that In the above image d|n means d divides n. You are given Q queries. For each query, find the sum of al, a(l+1), a(l+2), ..... a(r-1), ar, for given values of l and r. Since, answer is larger, output is modulo (109 + 7). Input section The first line contains, Q, denoting the number of queries. Each query contains 2 i

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