luogu#P1192. 台阶问题

台阶问题

Problem Description

There are NN steps. You start at the bottom, and each time you can climb 1K1\sim K steps upward. How many different ways are there to reach the NN-th step?

Input Format

Two positive integers N,KN,K.

Output Format

A single positive integer ans(mod100003)ans\pmod{100003}, the number of different ways to reach the NN-th step.

5 2
8

Hint

  • For 20%20\% of the testdata, 1N101\leq N\leq10, 1K31\leq K\leq3.
  • For 40%40\% of the testdata, 1N10001\leq N\leq1000.
  • For 100%100\% of the testdata, 1N1000001\leq N\leq100000, 1K1001\leq K\leq100.

Translated by ChatGPT 5