← All problemsSign in

Binomial Fever

CodeChefRating 2629Open on judge ↗

Chef loves dealing with binomial coefficients. Today, he came across an interesting problem, but he is currently busy in the kitchen. Can you help Chef solve this problem? You are given three positive integers $N$, $p$ and $r$. Calculate the sum $$S = \sum\limits_{i=0}^{N} \binom{p^i}{r} \,.$$ Since this sum could be very large, calculate it modulo $998,244,353$. ### Input - The first l

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