← All problemsSign in

Series Sum

You are given a simple recursive function f, f(i) = 3*f(i-2) + 4*f(i-1). You also have an array x of size n with values initialized to 0 Then, you will be given q queries in the form l, r where l i by f(i-l+1). Atlast, you have to print the array x after q queries. No need to print the array for every query. Input First line contains two integers n and q. Second line contains the values fo

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