{"raw_statement":[{"iden":"problem statement","content":"You are given positive integers $N$ and $M$. Here, $N<M$.\nA sequence of $N$ non-negative integers $a=(a_1,a_2,\\cdots,a_N)$ is said to be a **good** sequence when it satisfies the following condition:\n\n*   $0 \\leq a_1 \\leq a_2 \\leq \\cdots \\leq a_N \\leq M$.\n\nFor a good sequence $a$, let $f(a)$ be the sequence resulting from sorting $(a_1-1,a_2-2,\\cdots,a_N-N)$ in ascending order.\nFor each $k=1,2,\\cdots,N$, solve the following problem.\n\n*   Assume that we have found the $k$\\-th element of $f(a)$ for every possible good sequence $a$. Find the sum, modulo $998244353$, of these values.\n\n※ The answer should be between $0$ and $998244352$ even if the sum is negative."},{"iden":"constraints","content":"*   $1 \\leq N < M \\leq 10^6$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"2 3"},{"iden":"sample output 1","content":"998244349\n4\n\nHere are all possible $a$ and the corresponding $f(a)$.\n\n*   $a=(0,0)$: $f(a)=(-2,-1)$\n*   $a=(0,1)$: $f(a)=(-1,-1)$\n*   $a=(0,2)$: $f(a)=(-1,0)$\n*   $a=(0,3)$: $f(a)=(-1,1)$\n*   $a=(1,1)$: $f(a)=(-1,0)$\n*   $a=(1,2)$: $f(a)=(0,0)$\n*   $a=(1,3)$: $f(a)=(0,1)$\n*   $a=(2,2)$: $f(a)=(0,1)$\n*   $a=(2,3)$: $f(a)=(1,1)$\n*   $a=(3,3)$: $f(a)=(1,2)$\n\nThus, the sum of the first elements is $-4$, and the sum of the second elements is $4$."},{"iden":"sample input 2","content":"3 4"},{"iden":"sample output 2","content":"998244329\n0\n24"},{"iden":"sample input 3","content":"4 6"},{"iden":"sample output 3","content":"998244233\n35\n175\n330"},{"iden":"sample input 4","content":"10 1000000"},{"iden":"sample output 4","content":"297189103\n747015740\n88545731\n123651717\n920498165\n977169022\n775771117\n810877103\n152407094\n602233731"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}