← All problemsSign in

Combinations

Assume you have $K$ types of objects, each with infinite supply. You are given $(2N - 2)$ places to place those objects. A good placement is one which has exactly $N$ consecutive places occupied by object of same type. Find the number of doing so. Since the answer can be large, output the answer modulo $(10^9 + 7)$. Input format The first line contains a single integer, $T$, denoting the nu

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