You are given a natural number n and integers cn−1,cn−2,…,c1,c0. Consider the equation
xn+cn−1xn−1+cn−2xn−2+⋯+c1x+c0=0
where c0=0, all n roots of the equation are real, and every root r satisfies −10≤r≤10. The same value may occur as a root more than once.
Write a program that counts how many of the n roots are irrational. Roots are counted with multiplicity, so an irrational root that occurs three times counts as 3.