Tea time in the grand garden
시간 제한2초메모리 제한1024 MB
길이 N+2이고 양 끝이 0인 음이 아닌 정수 수열 중 상승분의 합(양의 증가량의 합)이 정확히 K인 수열의 개수를 998244353으로 나눈 나머지를 구한다.
문제
Appropriate temperature changes are essential for brewing delicious tea. Noli has been taught a recipe for delicious tea.
The recipe is represented by a sequence of non-negative integers of length . She must change the temperature accordingly.
Raising the temperature is hard work. The cost of a recipe is defined by the following .
Noli has forgotten the recipe she was taught. All she remembers is that and that the cost was .
How many possible recipes can be considered? Find the remainder of the number of possible recipes divided by .
Note that two recipes are different when the values of are different for any ().
입력
출력
Output the remainder of the number of possible recipes divided by . Add a new line at the end of the output.
제한
- All inputs consist of integers.
힌트
In Sample Input 1, There are five possible sequences .