Palindrome Counter
时间限制:C/C++/Rust/Pascal 4秒,其他语言8秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Define the palindrome value of a string s as the number of non-empty strings t such that:

  • t is a palindrome, that is, it reads the same forwards and backwards.
  • t is a contiguous substring of s.

For example, if s is "\texttt{aba}", then string t can be "\texttt{a}", "\texttt{b}", or "\texttt{aba}", so the palindrome value of s is 3.

Find the sum of palindrome values of all strings with length n and character set size k. Since the answer may be too large, output it modulo 998\,244\,353.

输入描述:

The first line contains two integers n, k (1\le n \le 128, 1 \le k \le 10^{5}), denoting the length of the string and the character set size.

输出描述:

Output a single integer, representing the answer, modulo 998\,244\,353.
示例1

输入

复制
4 2

输出

复制
64
示例2

输入

复制
5 3

输出

复制
1167