Rope
CodeChefOpen on judge ↗
Raghav has a rope of length N. He wants to keep the rope by making exactly M folds (illustrated below). However, a fold must not spill over the fold below it to keep the rope intact. Help him by calculating the number of ways in which it can be done. Output answer modulo 1000000007 (10^9 + 7). A rope with 6 folds : ---------- | ------------ | ---------------- | ------------------ | ------------
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