Logo
(追記) (追記ここまで)

23453번 - Dirichlet $k$-th root 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 256 MB105361446.667%

문제

Mathematician Pang learned Dirichlet convolution during the previous camp. However, compared with deep reinforcement learning, it's too easy for him. Therefore, he did something special.

If $f,g: \{1,2,\ldots,n\} \to \mathbb {Z} $ are two functions from the positive integers to the integers, the Dirichlet convolution $f * g$ is a new function defined by: $$(f * g)(n) =\sum_{d \mid n}f(d)g ({\frac {n}{d}}) .$$

We define the $k$-th power of an function $g=f^k$ by $$ f^{k}=\underbrace {f * \dots * f} _{k {\textrm {times}}}.$$

In this problem, we want to solve the inverse problem: Given $g$ and $k,ドル you need to find a function $f$ such that $g=f^k$.

Moreover, there is an additional constraint that $f(1)$ and $g(1)$ must equal to 1ドル$. And all the arithmetic operations are done on $\mathbb{F}_{p}$ where $p=998244353,ドル which means that in the Dirichlet convolution, $(f * g)(n) =\left(\sum_{d \mid n}f(d)g ({\frac {n}{d}})\right) \bmod p$.

입력

The first line contains two integers $n$ and $k (2\leq n\leq 10^5,1\leq k<998244353)$ .

The second line contains n integers $g(1), g(2),..., g(n)$ (0ドル\le g(i)<998244353, g(1)=1$).

출력

If there is no solution, output $-1$.

Otherwise, output $f(1), f(2), ..., f(n)$ (0ドル\le f(i)<998244353, f(1)=1$). If there are multiple solutions, print anyone.

제한

예제 입력 1

5 2
1 8 4 26 6

예제 출력 1

1 4 2 5 3

힌트

출처

Contest > Open Cup > 2019/2020 Season > Stage 10: Grand Prix of Xi’An C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /