#P1192. 台阶问题

    ID: 192 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>递推斐波那契,Fibonacci线性递推,递推式

台阶问题

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