← All problemsSign in

Power Sums

CodeChefRating 2824Open on judge ↗

Chef has n non-negative integers a1, a2, ..., an. He defined the following function f(k) = (a1k + a2k + ... + ank) mod (109 + 7) over them. Chef knows the values f(1), f(2), ..., f(n), but he has forgotten the values a1, a2, ..., an. Now Chef wants to evaluate the function f over some integers (total Q of them), can you please help him in this? Input The first line of the input contain

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