{"raw_statement":[{"iden":"problem statement","content":"PCT-kun created the following problem.\n\n> **Increasing Problem**You are given a length-$N$ sequence of non-negative integers $A_1,A_2,\\dots,A_N$. You can perform the following operation any number of times (possibly zero).\n> \n> *   Choose an integer $i$ such that $1 \\le i \\le N$, and increase or decrease $A_i$ by $1$.\n> \n> Your goal is to make $A$ non-decreasing. Find the minimum number of operations required to achieve this goal.\n\nThinking that this problem is too easy to be placed at the end of the contest, PCT-kun has revised it as follows.\n\n> **Many Increasing Problems**There are $M^N$ integer sequences $A$ of length $N$ where all elements are between $1$ and $M$, inclusive. Find the sum of the answers to **Increasing Problem** for all those sequences, modulo $998244353$.\n\nSolve **Many Increasing Problems**."},{"iden":"constraints","content":"*   $1 \\le N,M \\le 10^5$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"2 2"},{"iden":"sample output 1","content":"1\n\nLet us solve **Increasing Problem** for all sequences of length $2$ where all elements are between $1$ and $2$, inclusive.\n\n*   For $A=(1,1)$, the answer is $0$.\n*   For $A=(1,2)$, the answer is $0$.\n*   For $A=(2,1)$, the answer is $1$.\n*   For $A=(2,2)$, the answer is $0$.\n\nTherefore, the final answer is $0+0+1+0=1$."},{"iden":"sample input 2","content":"6 4"},{"iden":"sample output 2","content":"14668"},{"iden":"sample input 3","content":"163 702"},{"iden":"sample output 3","content":"20728656"},{"iden":"sample input 4","content":"98765 99887"},{"iden":"sample output 4","content":"103564942"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}