← All problemsSign in

Chef and Equations

CodeChefRating 2877Open on judge ↗

You are given a sequence of positive integers $A_0, A_1, \ldots, A_{N-1}$ and a sequence of non-negative integers $C_0, C_1, \ldots, C_{N-1}$. Let's denote $M = 998244353$. You know that for $$C_i = \sum_{j = 0}^{N-1} B_j A_j^i \mod M$$ holds for each valid $i$, with some coefficients $B_0, B_1, \dots, B_{N-1}$ (such that $0 \le B_i \lt M$ for each $i$). Your task is to find these coefficients. 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