There are $$$n$$$ countries numbered from $$$1$$$ to $$$n$$$. To "strengthen" their local economies, the countries are planning to introduce a new system for restricting trade between countries: It is only allowed for a company to export or import goods between countries $$$a$$$ and $$$b$$$ if it buys a trading license for doing so. You are running a business in country $$$1$$$ which needs to be able to trade with every other country. To be as cost efficient as possible, you will buy a set of licenses such that its total cost is minimized and you can trade with every other country directly or indirectly.
Currently, it is not known how expensive the licenses will be. According to historical data, it is most reasonable to assume that the cost of the trading licenses is a uniformly random integer between $$$0$$$ and $$$t$$$ (inclusive), and the costs for every pair of countries are chosen independently.
You wonder: what is the expected cost that you will have to pay for the trading licenses?
More formally, given two integers $$$n$$$ and $$$t$$$, we assign an integer weight from $$$\{0, \ldots, t\}$$$ to every edge of a complete graph on $$$n$$$ vertices uniformly and independently at random. What is the expected value of the minimum spanning tree?
Compute the answer modulo $$$998\,244\,353$$$.
The input consists of:
Output one integer, the expected value of the minimum spanning tree modulo $$$998\,244\,353$$$.
Formally, let $$$M = 998\,244\,353$$$. It can be shown that the answer can be expressed as an irreducible fraction $$$\frac{p}{q}$$$, where $$$p$$$ and $$$q$$$ are integers and $$$q \not \equiv 0 \pmod{M}$$$. Output the integer equal to $$$p \cdot q^{-1} \bmod M$$$. In other words, output such an integer $$$x$$$ that $$$0 \le x \lt M$$$ and $$$x \cdot q \equiv p \pmod{M}$$$.
2 2
1
3 1
374341633
1 0
0
42 1337
111521655
In the second sample, the answer is $$$\frac{5}{8}$$$.