Topic Link: Click to open the link
#279. "UTR #2" topic AC Channel Statistics description Submit a custom test
The difficulty was set, and the ambitious Jimmy Ben began to look for the wisdom of the inhabitants of God's planet.
However, Jimmy did not anticipate that the residents of God's Ben Planet told Jimmy more: "This year God Ben Planet economic downturn, we all want to stay at home, which has the mind out of the question." ”
To save the situation, Jimmy has decided to build a high-speed transmission channel for God's Ben Planet to promote communication between the different regions of the planet.
The Ben Planet has an nn-block town. For any two small town v,uv,u (V≠uv≠u), Jimmy asked to establish a transmission time of W (V,u) W (v,u) in the v,uv,u between a non-transmitting channel, where W (v,u) W (v,u) is not more than KK non-negative integer. Upon completion, the inhabitants of God's Ben Planet May depart from a small city and pass through one or several transmission passages to another town to communicate with each other, and spend time on the transmission time of all passing channels.
The question of Jimmy has not decided the transfer time of each transmission channel value, but for any two small city v,uv,u, decided to arrive from the VV to uu the shortest time to be equal to D (v,u) d (v,u). But Jimmy more question masterful, so he found you-wind glass do not Gewitsch, please help Jimmy more question how many different ways to meet the conditions of the transmission channel construction plan it.
Because the number of scenarios can be large, you only use the output scheme number to 998244353998244353 (7x17x223+17x17x223+1, a prime) after the result of modulo. input
The first row of two integers n,kn,k. Guaranteed n≥1,k≥0n≥1,k≥0.
Next nn line, each line has a non-negative integer NN, the first