Sonic And K - Separated Elements
CodeChefOpen on judge ↗
Sonic has an array of natural numbers from $1$ to $N$. He selects $M$ elements from the array. Now Sonic is satisfied only if the difference between all pair of elements is at least $K$. He is interested to find the number of ways of picking such $M$ elements which make him satisfied. Help him calculate the same. As the number of ways can be large output the answer modulo $10 ^ 9 + 7$. ###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