{"problem":{"name":"F. Polynom","description":{"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","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF100F"},"statements":[{"statement_type":"Markdown","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.\n\n## Input\n\nThe first line of the input contains _n_ (1 ≤ _n_ ≤ 9). The following _n_ lines contain integer _a__i_ ( - 10 ≤ _a__i_ ≤ 10).\n\n## Output\n\nPrint the given polynom in a standard way. Note, that the answer in this problem response uniquely determined.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","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请以标准形式输出该多项式。注意，本题的答案是唯一确定的。\n\n## Input\n\n输入的第一行包含 #cf_span[n]（#cf_span[1 ≤ n ≤ 9]）。接下来的 #cf_span[n] 行每行包含一个整数 #cf_span[ai]（#cf_span[ - 10 ≤ ai ≤ 10]）。\n\n## Output\n\n请以标准形式输出该多项式。注意，本题的答案是唯一确定的。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**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.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF100F","tags":["implementation"],"sample_group":[["2\n-1\n1","X^2-1"],["2\n1\n1","X^2+2*X+1"]],"created_at":"2026-03-03 11:00:39"}}