Dirichlet k -th root
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

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:

We define the k-th power of an function by

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 4 2 5 3