KMSL4B - Roots of polynomial
p(x)=pk x^k + ... + p0x^0 is a given polynomial of degree at most 20. Check whether all roots of p() belong to the open unit disc |z|< 1 on the complex plain.
First the number of polynomials appears. Then the data for the following polynomials follows in the consecutive lines. For each of them first the degree is given, then in the following line the coefficients p0, p1, ... appear, separated by spaces.
Each line of the output is the solution for the following polynomials. It shoud be '1' if the roots of p() belong to the open unit disc, or '0' otherwise.
Input: 2 2 1 2 1 2 0.5 1 1 Output: 0 1
This is a rather hard mathematical problem. You can look for Schur-Cohn algorithm if you need help on this one.