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]<<" ";
}

 

全部评论

相关推荐

合适才能收到offe...:招聘上写这些态度傲慢的就别继续招呼了,你会发现hr和面试官挺神的,本来求职艰难就可能影响一些心态了,你去这种公司面试的话,整个心态会炸的。
点赞 评论 收藏
分享
03-10 11:23
门头沟学院 Java
鹿LF:计算机面试就跟数学题一样,没什么实际价值,但只能这么筛选,本质是考察你的努力,智力和学习能力
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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