SP6731 COEF - Coeficientes
Description
The problem is to calculate the coefficients in expansion of polynomial _(x $ _{1} $ +x $ _{2} $ +...+x $ _{k} $ ) $ ^{n} $_ .
Input Format
The input will consist of a set of pairs of lines. The first line of the pair consists of two integers _n_ and _k_ separated with space (_0 < n, k ). This integers define the power of the polynomial and the amount of the variables. The second line in each pair consists of _k_ non-negative integers _n $ _{1} $ , ..., n $ _{k} $ ,_ where _n $ _{1} $ +...+n $ _{k} $ =n_._
Output Format
For each input pair of lines the output line should consist one integer, the coefficient by the monomial _x $ _{1} $ $ ^{n1} $ x $ _{2} $ $ ^{n2} $ ...x $ _{k} $ $ ^{nk} $_ in expansion of the polynomial _(x $ _{1} $ +x $ _{2} $ +...+x $ _{k} $ ) $ ^{n} $_ .