3365: Fixed Point

内存限制:128 MB 时间限制:2.000 S
评测方式:文本比较 命题人:
提交:23 解决:9

题目描述

 In mathematics, a fixed point (sometimes shortened to fixpoint, also known as an invariant point) of a function is a point that is mapped to itself by the function. That is to say, x is a fixed point of the function f  if and only if f(x) = x. For example, if f is defined on the real numbers by f(x)=x*x-3*x+4.,then 2 is a fixed point of f, because f(2) = 2.

Not all functions have fixed points: for example, if f is a function defined on the real numbers as f(x) = x + 1, then it has no fixed points, since x is never equal to x + 1 for any real number. In graphical terms, a fixed point means the point (x, f(x)) is on the line y = x, or in other words the graph of f  has a point in common with that line. The example f(x) = x + 1 is a case where the graph and the line are a pair of parallel lines.

------ http://en.wikipedia.org/wiki/Fixed_point_%28mathematics%29

Our problem is,for a defined on real number function:   

f(x)=a*x*x*x+b*x*x+c*x+d,how many different fixed points does it have?  

输入

There are multiple test cases.For each test cases, there are four integers a, b, c and d in a single line.
You can assume that -213<=a<=213, -213<=b<=213, -213<=c<=213, -213<=d<=213,and the number of the result is countable. 

输出

For each test case, output the answer  in a single line.

样例输入 复制

3 111 793 -3456
5 -135 811 0
-1 9 10 -81

样例输出 复制

3
3
3

来源/分类