CF755G.PolandBall and Many Other Balls

NOI/NOI+/CTSC

通过率:0%

时间限制:6.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

PolandBall is standing in a row with Many Other Balls. More precisely, there are exactly n Balls. Balls are proud of their home land — and they want to prove that it's strong.

The Balls decided to start with selecting exactly m groups of Balls, each consisting either of single Ball or two neighboring Balls. Each Ball can join no more than one group.

The Balls really want to impress their Enemies. They kindly asked you to calculate number of such divisions for all m where 1 ≤ m ≤ k. Output all these values modulo 998244353, the Enemies will be impressed anyway.

PolandBall 与许多其他球排成一列。更准确地说,恰好有 nn 个球。这些球为自己的祖国感到自豪——它们希望证明自己的祖国很强大。

这些球决定首先选出恰好 mm 组球,每组要么仅包含一个球,要么包含两个相邻的球。每个球最多只能属于一组。

这些球非常想给敌人留下深刻印象。它们友好地请求你计算出所有满足 1≤m≤k1 \leq m \leq k 的 mm 对应的分组方案数。请将所有结果对 998244353998244353 取模后输出(无论如何,敌人都会被震撼到)。

输入格式

There are exactly two numbers n and k (1 ≤ n ≤ 109, 1 ≤ k < 215), denoting the number of Balls and the maximim number of groups, respectively.

恰好有两个数 nn 和 kk(1 ≤ n ≤ 1091 ≤ n ≤ 10^9,1 ≤ k < 2151 ≤ k < 2^{15}),分别表示球的数量和组数的最大值。

输出格式

You should output a sequence of k values. The i-th of them should represent the sought number of divisions into exactly i groups, according to PolandBall's rules.

你应该输出一个包含 kk 个数值的序列。其中第 ii 个数值应表示按照 PolandBall 的规则,将对象恰好划分为 ii 组的方案数。

输入输出样例

  • 输入#1

    3 3

    输出#1

    5 5 1
  • 输入#2

    1 1

    输出#2

    1
  • 输入#3

    5 10

    输出#3

    9 25 25 9 1 0 0 0 0 0

说明/提示

In the first sample case we can divide Balls into groups as follows:

{1}, {2}, {3}, {12}, {23}.

{12}{3}, {1}{23}, {1}{2}, {1}{3}, {2}{3}.

{1}{2}{3}.

Therefore, output is: 5 5 1.

在第一个样例中,我们可以将小球划分为如下若干组:

{1}, {2}, {3}, {12}, {23}。

{12}{3}, {1}{23}, {1}{2}, {1}{3}, {2}{3}。

{1}{2}{3}。

因此,输出为:5 5 1。

输入解题思路,AI测评打分。不知道怎么写?

首页