405045: GYM101754 D Sports Analytics

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Sports Analyticstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

n athletes are going to take part in the Berlandian multisport championship. The competition will consist of k stages, and in each stage an athlete can score any real number of points in range from 0 to 1.

Little boy Oleg loves sports analytics, and he is going to highlight the championship in his sports blog. Oleg doesn't know anything about the competitors, or how the competition is arranged. Though, Oleg knows probability theory very well, so he is going to assume that each athlete scores random number of points equidistributed on the segment [0, 1] in each stage. Oleg also assumes that scores of all athletes on all stages are mutually independent.

The most important part of analytics is to comprise a final rating list, that is, order all athletes from the best to the worst. After studying hundreds of different rating systems, Oleg decided to upload all possible fair rating lists. Oleg thinks that in a fair rating list any athlete (except for the last) scored strictly greater number of points than the subsequent athlete in at least one stage of the competition.

Note that in a fair rating list one athlete can still be higher than another athlete even if he lost him in all stages. Consider a situation where in a two-stage competition the scores of the athlete 1 are (0.2, 0.2), the scores of the athlete 2 are (0.8, 0.8), and the scores of the athlete 3 are (0, 1). Then, the rating table (1, 3, 2) is fair, since the athlete 1 beat the athlete 3 in the first stage, and the athlete 3 beat the athlete 2 in the second stage, however, the athlete 1 lost to the athlete 2 in both.

The championship has not started yet, but Oleg wants to reserve enough space for the rating tables on his hosting. To do this, he asked you to find the average number of ways to comprise a fair rating list at the end of the competition. Oleg also wants to train his number theory skills, so he wants the answer modulo P = 998 244 353, that is, if the answer is an irreducible fraction A / B, you have to output such an integer x that 0 ≤ x < P and A ≡ B·x ± od P (it is guaranteed that such x exists and is unique).

The average value of an integer-valued random variable is defined as , where the sum is over all integers, and px is the probability of the variable begin equal to x.

Input

The only line contains two integers n and k — the number of athletes and stages in the competition respectively (1 ≤ n, k ≤ 1000).

Output

Print one number — the average number of fair rating lists modulo 998 244 353.

ExamplesInput
10 1
Output
1
Input
1 10
Output
1
Input
2 2
Output
499122178
Input
5 3
Output
778699985
Note

In the first sample, there is only one fair rating list for every outcome, that is, sorted by points in the only stage in decreasing order (except for the case when several athletes share the same score, but the probability of this event is zero).

In the second sample, there is only one fair list that consists of one athlete.

In the third sample the answer is , and in the fourth sample the answer is .

加入题单

上一题 下一题 算法标签: