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

 

全部评论

相关推荐

真的很糟糕:一般说看能力给工资意思就是给不起的借口
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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