-->
当前位置:首页 > 题库

PROGRAMMING:cross the river

Luz5年前 (2021-05-10)题库412
There is a river in which there are n stones. Now you can only walk from one side of the river to the other side. You can cross up to 3 stones at each step.
But unfortunately, a stone was trampled loose by a person who crossed the river, so for safety, later people can't step on it any more.
If a man wants to go to the other side of the river, how many ways does he have?
######Note: if we number the stones from $$1 $$to $$n $$, then the stones that are trampled loose are numbered $$k $.
###Input format:
Multi group input
For each set of inputs, $$2 $$integers, $$n $$and $$k $$are given on one line.
The data is guaranteed to be $$1 / Leq K < n / Leq 10 ^ {6} $$.
###Output format:
For each group of input, output a line, representing the number of river crossing schemes corresponding to the input.
######Results the remainder of $$998244353 $$was output.
###Input example:
Here is a set of inputs. For example:
```in
4 3
```
###Output example:
The corresponding output is given here. For example:
```out
three
```







answer:If there is no answer, please comment