Sum and Product#13078

Sum and Product

1 second
256 megabytes

Olenka just learned about real numbers and immediately invented a game. She names a real number , and her older brother must write on the board one or several real numbers a_1, a_2, \ldots, a_n so that their sum equals , and their product equals :

a_1 + a_2 + \ldots + a_n = s, \qquad a_1 \cdot a_2 \cdot \ldots \cdot a_n = 1.

The brother is lazy, so he wants to write as few numbers as possible. Help him: for each number that Olenka names, find the smallest possible n \ge 1 and any suitable numbers a_1, \ldots, a_n.

Input

The first line contains a single integer (1 \le t \le 10^4) — the number of numbers that Olenka named.

Each of the next lines contains a single real number (|s| \le 10^9), written with exactly three digits after the decimal point.

Output

For each of the numbers, output two lines. The first line should contain an integer — the smallest number of real numbers whose sum is exactly equal to , and whose product is exactly equal to . The second line should contain real numbers a_1, a_2, \ldots, a_n, separated by spaces. It can be proven that such numbers always exist.

Since the numbers are output with limited precision, an answer is accepted if is the smallest possible, and the output numbers satisfy the following conditions:

  • |a_i| \le 10^{10} for each ;

  • |(a_1 + a_2 + \ldots + a_n) - s| \le 10^{-6} \cdot \max(1, |s|);

  • |a_1 \cdot a_2 \cdot \ldots \cdot a_n - 1| \le 10^{-6}.

The numbers can be output either in ordinary decimal notation (for example, -0.618034), or in exponential notation (for example, 1.5e-07).

Examples

Example 1

Loading
Loading

Note

In the example, for s = 1 one number is enough. For s = 2.5 one can take 0.5 + 2 = 2.5 and 0.5 \cdot 2 = 1. For s = 0.5 neither one number nor a pair of numbers works, but the triple -1, 2, -0.5 works. For s = 0 the output numbers , , are correct only approximately (the exact values are \frac{1 \pm \sqrt{5}}{2}), but they satisfy the conditions above.

The precision 10^{-6} can be achieved using ordinary double-precision floating-point arithmetic (the double type).