← All problemsSign in

Guess All

CodeChefRating 2562Open on judge ↗

**This is an interactive task.** Note that, we are using $0 -$ based indexing. Chef has a hidden array $A$ of length $K$. He also has a special integer function $F$ which is defined over **non-negative integers** as follows: - If $(0\leq i \lt K)$, $F(i)=A_i$; - If $(i \ge K)$, $F(i) = -\sum_{j=1}^{K} F(i-j)$. You are given an array $B$ consisting of $N$ non-negative integers. Calculate the va

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