QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#13643. 喂鸽子

統計

Little Z is a pigeon keeper. One day, Little Z feeds corn to his pigeons. There are $n$ pigeons in total, and every second, Little Z chooses one pigeon with equal probability and gives it one grain of corn. A pigeon is full if and only if the number of corn grains it has eaten is $\ge k$.

Little Z wants you to tell him the expected number of seconds until all pigeons are full.

Assuming the answer in its simplest fractional form is $\frac{a}{b}$, you need to find $w$ such that $a \equiv b \cdot w \pmod{998244353} \; (0 \le w < 998244353)$.

Note: To help contestants verify the correctness of their programs, the provided files include the source code of a simulator, which contestants should compile themselves. This simulator will repeatedly simulate the process described in the problem indefinitely and output the average number of seconds per simulation as a real number. The simulator guarantees an accuracy of $3 \sim 4$ significant digits.

Input

A single line containing two positive integers $n$ and $k$.

Output

A single line containing the answer.

Examples

Input 1

1 1

Output 1

1

Subtasks

This problem is evaluated using subtasks.

Subtask 1 ($4pts$): $n = 1$.

Subtask 2 ($11pts$): $k = 1$.

Subtask 3 ($19pts$): $k = 2$.

Subtask 4 ($46pts$): $k \le 50$.

Subtask 5 ($20pts$): No special constraints.

For all data, $n \le 50$ and $k \le 1000$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.