Prakhar's Polynomial Reconstruction Algorithm

Let \( p(x) = a_0 + a_1x + a_2x^2 + \dots + a_nx^n \) be your univariate polynomial with integer coefficients \( a_i \in \mathbb{Z} \).

Define \( A = \max_{0 \le i \le n} |a_i| \), i.e., the maximum absolute value among the coefficients of \( p(x) \).

Choose any \( k > 2A \) and enter the following values:

Note: If the value of A you entered does not match with the output polynomial, it means you have entered incorrect values.

Example: If your polynomial is \( p(x) = 2 + 3x - 7x^2 + 4x^3 \), then \( A = 7 \). You can choose any \( k \) such that \( k > 2A = 14 \). For example, \( k = 17 \).