E. Count The Blocks

194 篇文章 1 订阅
10 篇文章 0 订阅

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

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值