← All problemsSign in

Series Sum

CodeChefRating 2869Open on judge ↗

You are given $N$ integers $a_1, a_2, \dots, a_N$. Let's define functions $f$ and $g$: $$f(x, k) = (x + a_1)^k + (x + a_2)^k + \dots + (x + a_N)^k$$ $$g(t, k) = f(0, k) + f(1, k) + \dots + f(t, k)$$ You are also given integers $T$ and $K$. Calculate $g(T, i)$ modulo $10^9 + 7$ for each $i$ between $0$ and $K$ inclusive. ### Input - The first line of the input contains three space-separated int

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