CF1580F.Problems for Codeforces
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
XYMXYM and CQXYM will prepare n problems for Codeforces. The difficulty of the problem i will be an integer ai , where ai≥0 . The difficulty of the problems must satisfy ai+ai+1<m ( 1≤i<n ), and a1+an<m , where m is a fixed integer. XYMXYM wants to know how many plans of the difficulty of the problems there are modulo 998244353 .
Two plans of difficulty a and b are different only if there is an integer i ( 1≤i≤n ) satisfying ai=bi .
输入格式
A single line contains two integers n and m ( 2≤n≤50000 , 1≤m≤109 ).
输出格式
Print a single integer — the number of different plans.
输入输出样例
输入#1
3 2
输出#1
4
输入#2
5 9
输出#2
8105
输入#3
21038 3942834
输出#3
338529212
说明/提示
In the first test case, the valid a are: [0,0,0] , [0,0,1] , [0,1,0] , [1,0,0] .
[1,0,1] is invalid since a1+an≥m .