logo AlgoBeat OnlineJudge
登录 注册

#214045. [EC Final 2019] Dirichlet k-th root

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 are two functions from the positive integers to the integers, the Dirichlet convolution is a new function defined by: (f * g)(n) =\sum_{d \mid n}f(d)g ({\frac {n}{d}}) .

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

In this problem, we want to solve the inverse problem: Given and , you need to find a function such that .

Moreover, there is an additional constraint that and must equal to . And all the arithmetic operations are done on where , which means that in the Dirichlet convolution, .

输入格式

The first line contains two integers and .

The second line contains n integers ().

输出格式

If there is no solution, output .

Otherwise, output (). If there are multiple solutions, print anyone.

样例

样例输入 1

5 2
1 8 4 26 6

样例输出 1

1 4 2 5 3