{"raw_statement":[{"iden":"statement","content":"You are given a polynom in form _p_(_x_) = (_x_ + _a_1)·(_x_ + _a_2)·... (_x_ + _a__n_). Write Pike program to print it in a standard form _p_(_x_) = _x__n_ + _b_1_x__n_ - 1 + ... + _b__n_ - 1_x_ + _b__n_. You should write each addend in form «_C*X^K_» (for example, _5*X^8_).\n\nPlease, write the polynom in the shortest way, so you should skip unnecessary terms: some terms «_C*X^K_» should be reduced or even omitted. Look for the samples for clarification."},{"iden":"input","content":"The first line of the input contains _n_ (1 ≤ _n_ ≤ 9). The following _n_ lines contain integer _a__i_ ( - 10 ≤ _a__i_ ≤ 10)."},{"iden":"output","content":"Print the given polynom in a standard way. Note, that the answer in this problem response uniquely determined."},{"iden":"examples","content":"Input\n\n2\n-1\n1\n\nOutput\n\nX^2-1\n\nInput\n\n2\n1\n1\n\nOutput\n\nX^2+2*X+1"}],"translated_statement":[{"iden":"statement","content":"给定一个多项式，形式为 $p(x) = (x + a1)·(x + a2)·... (x + an)$。请编写一个 Pike 程序，将其以标准形式 $p(x) = x^n + b1x^{n - 1} + ... + bn - 1x + bn$ 输出。每个项应写成 «_C*X^K_» 的形式（例如，_5*X^8_）。\n\n请以最简形式写出该多项式，因此应省略不必要的项：某些 «_C*X^K_» 项应被化简甚至省略。请参考样例以获得更清晰的说明。\n\n输入的第一行包含 #cf_span[n]（#cf_span[1 ≤ n ≤ 9]）。接下来的 #cf_span[n] 行每行包含一个整数 #cf_span[ai]（#cf_span[ - 10 ≤ ai ≤ 10]）。\n\n请以标准形式输出该多项式。注意，本题的答案是唯一确定的。"},{"iden":"input","content":"输入的第一行包含 #cf_span[n]（#cf_span[1 ≤ n ≤ 9]）。接下来的 #cf_span[n] 行每行包含一个整数 #cf_span[ai]（#cf_span[ - 10 ≤ ai ≤ 10]）。"},{"iden":"output","content":"请以标准形式输出该多项式。注意，本题的答案是唯一确定的。"},{"iden":"examples","content":"输入\n2\n-1\n1\n输出\nX^2-1\n\n输入\n2\n1\n1\n输出\nX^2+2*X+1"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 9 $.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of integers with $ -10 \\leq a_i \\leq 10 $.  \nDefine the polynomial:  \n$$ p(x) = \\prod_{i=1}^n (x + a_i) $$  \n\n**Objective**  \nExpand $ p(x) $ into the standard form:  \n$$ p(x) = x^n + b_1 x^{n-1} + b_2 x^{n-2} + \\cdots + b_{n-1} x + b_n $$  \nand output each non-zero term $ b_k x^{n-k} $ (for $ k = 0, \\dots, n $, where $ b_0 = 1 $) in the format:  \n- $ \\texttt{C*X^K} $ if $ |C| > 1 $ or $ K = 0 $,  \n- $ \\texttt{X^K} $ if $ C = 1 $ and $ K > 0 $,  \n- $ \\texttt{-X^K} $ if $ C = -1 $ and $ K > 0 $,  \n- $ \\texttt{C} $ if $ K = 0 $ and $ |C| > 1 $,  \n- $ \\texttt{1} $ or $ \\texttt{-1} $ if $ K = 0 $ and $ C = \\pm 1 $,  \n- omit terms with $ b_k = 0 $.  \n\nTerms must be printed in descending order of degree, with no leading `+` for the first term.","simple_statement":null,"has_page_source":false}