How many sequences
Consider the sequence of K natural numbers: a1, a2, ..., aK. Tooru thinks that this sequence is nice if and only if: - a1+a2+...+aK = N - a1 a2 aK - ai+1 - ai D for every natural i, smaller than K - a1 D You are given N, K and D. Please, count the number of nice sequences for her. This number can be huge, so we ask you to output it modulo 109+7. Input The first and only line of the input
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.
Sign in to chat with the tutor and save your progress.
Sign in to start