SP481 KMSL4B - Roots of polynomial

Description

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.

Input Format

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.

Output Format

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.