How to derive this formula for this atcoder problem.

Revision en1, by spirited_away_, 2019-08-05 05:02:10

Why is the answer to this problem always ( N + K — 3) / (K — 1).

Can anyone please help me. editorial is not clear.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English spirited_away_ 2019-08-05 05:02:10 236 Initial revision (published)