E. Count The Blocks

链接:https://codeforces.ml/contest/1327/problem/E

You wrote down all integers from 00 to 10n−110n−1, padding them with leading zeroes so their lengths are exactly nn. For example, if n=3n=3 then you wrote out 000, 001, ..., 998, 999.

A block in an integer xx is a consecutive segment of equal digits that cannot be extended to the left or to the right.

For example, in the integer 0002773400000027734000 there are three blocks of length 11, one block of length 22 and two blocks of length 33.

For all integers ii from 11 to nn count the number of blocks of length ii among the written down integers.

Since these integers may be too large, print them modulo 998244353998244353.

Input

The only line contains one integer nn (1≤n≤2⋅1051≤n≤2⋅105).

Output

In the only line print nn integers. The ii-th integer is equal to the number of blocks of length ii.

Since these integers may be too large, print them modulo 998244353998244353.

Examples

input

Copy

1

output

Copy

10

input

Copy

2

output

Copy

180 10

代码:

#include<bits/stdc++.h>
using namespace std;
long long n,t,k,m,r,s,mod=998244353;
long long a[1000001];
int main()
{
    cin>>n;
    s=1;
    k=810;
    a[1]=10;
    a[2]=180;
    for(int i=3;i<=n;i++)
    {
    	a[i]=a[i-1]*10%mod+k;
    	a[i]%=mod;
    	k*=10;
    	k%=mod;
    	
    }
    for(int i=n;i>=1;i--)
    cout<<a[i]<<" ";
}

 

全部评论

相关推荐

11-13 20:16
已编辑
厦门理工学院 软件测试
专业嗎喽:硕佬,把学校背景放后面几段,学校背景双非还学院,让人看了就不想往下看。 把实习经历和个人奖项放前面,用数字化简述自己实习的成果和掌握的技能,比如负责项目一次通过率90%,曾4次发现项目潜在问题风险为公司减少损失等等
点赞 评论 收藏
分享
黑着眼圈看手机:pdd秋招笔试挂了,春招还行吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务