310982: CF1916H2. Matrix Rank (Hard Version)

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H2. Matrix Rank (Hard Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

This is the hard version of the problem. The only differences between the two versions of this problem are the constraints on $k$. You can make hacks only if all versions of the problem are solved.

You are given integers $n$, $p$ and $k$. $p$ is guaranteed to be a prime number.

For each $r$ from $0$ to $k$, find the number of $n \times n$ matrices $A$ of the field$^\dagger$ of integers modulo $p$ such that the rank$^\ddagger$ of $A$ is exactly $r$. Since these values are big, you are only required to output them modulo $998\,244\,353$.

$^\dagger$ https://en.wikipedia.org/wiki/Field_(mathematics)

$^\ddagger$ https://en.wikipedia.org/wiki/Rank_(linear_algebra)

Input

The first line of input contains three integers $n$, $p$ and $k$ ($1 \leq n \leq 10^{18}$, $2 \leq p < 998\,244\,353$, $0 \leq k \leq 5 \cdot 10^5$).

It is guaranteed that $p$ is a prime number.

Output

Output $k+1$ integers, the answers for each $r$ from $0$ to $k$.

ExamplesInput
3 2 3
Output
1 49 294 168 
Input
1 51549919 2
Output
1 51549918 0 

Output

题目大意:这是一个关于矩阵秩的问题的困难版本。给定整数n、p和k,其中p是一个质数。对于每个r从0到k,找出在整数模p的字段上,秩为r的n×n矩阵A的数量。由于这些值很大,你只需要将它们模998,244,353的结果输出。

输入数据格式:输入的第一行包含三个整数n、p和k(1≤n≤10^18,2≤p<998,244,353,0≤k≤5×10^5)。保证p是一个质数。

输出数据格式:输出k+1个整数,分别是每个r从0到k的答案。

示例:

输入:3 2 3
输出:1 49 294 168

输入:1 51549919 2
输出:1 51549918 0题目大意:这是一个关于矩阵秩的问题的困难版本。给定整数n、p和k,其中p是一个质数。对于每个r从0到k,找出在整数模p的字段上,秩为r的n×n矩阵A的数量。由于这些值很大,你只需要将它们模998,244,353的结果输出。 输入数据格式:输入的第一行包含三个整数n、p和k(1≤n≤10^18,2≤p<998,244,353,0≤k≤5×10^5)。保证p是一个质数。 输出数据格式:输出k+1个整数,分别是每个r从0到k的答案。 示例: 输入:3 2 3 输出:1 49 294 168 输入:1 51549919 2 输出:1 51549918 0

加入题单

上一题 下一题 算法标签: