QOJ.ac

QOJ

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

#13643. 喂鸽子

統計

小Z是养鸽子的人。一天,小Z给鸽子们喂玉米吃。一共有n只鸽子,小Z每秒会等概率选择一只鸽子并给他一粒玉米。一只鸽子饱了当且仅当它吃了的玉米粒数量$\ge k$。 小Z想要你告诉他,期望多少秒之后所有的鸽子都饱了。

假设答案的最简分数形式为$\frac{a}{b}$,你需要求出$w$,满足$a \equiv b \cdot w \pmod{998244353} \; (0 \le w < 998244353)$。

ps:为了方便选手确认自己程序的正确性,下发文件中包含一个模拟器的源码,请选手自行编译。该模拟器会无限地重复模拟题目中描述的过程,并将每次模拟的秒数的平均值以实数的形式输出,该模拟器能够保证$3 \sim 4$位有效数字的精确度。

输入格式

一行两个正整数$n,k$。

输出格式

一行一个数表示答案。

样例一

input

1 1

output

1

限制与约定

本题采用子任务的方式评测。

子任务一($4pts$):$n = 1$。

子任务二($11pts$):$k = 1$。

子任务三($19pts$):$k = 2$。

子任务四($46pts$):$k \le 50$。

子任务五($20pts$):无特殊限制。

对于所有的数据,$n \le 50$,$k \le 1000$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.