Find x1, x2, ..., xn:
x_1^p_1 + x_2^p_2 + ... + x_(n-1)^p_(n-1) ≡ x_n^p_n (mod 1e9+7)
Input:
Line 1: Positive integer n > 1
Line 2: n distinct prime numbers p1, p2, ..., pn (p1 * p2 * ... * pn <= 1e18)
Output:
1 set of n positive integers (x_1, x_2,..., xn) (1 <= x_i < 1e9+7)
For example,
Input 1:
2
3 5
Output 1:
1 1
(Because 1^3 ≡ 1^5 (mod 10^9 + 7))
Input 2:
3
2 3 7
Output 2:
8 4 2
(Because 8^2 + 4^3 ≡ 2^7 (mod 10^9 + 7))
If n = 2, (1,1) is always satisfied. If n > 2, I think we can use Constructive Algorithm, but up to now, I have no idea