#Lutece1985. 方程的解

方程的解

Migrated from Lutece 1985 方程的解

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给定一个四元二次方程:

AX12+BX22+CX32+DX42=0AX_1^2+BX_2^2+CX_3^2+DX_4^2=0

试求1000X1,X2,X3,X41000-1000 \le X_1,X_2,X_3,X_4 \le 1000非零整数解的个数。

Input

第一行四个整数A,B,C,DA,B,C,D

10000A,B,C,D10000-10000 \le A,B,C,D \le 10000

Output

第一行一个整数xx,表示方程整数解的个数。

Samples

-5891 4371 -5007 4394
3536
2996 4828 2392 -3903
3328
1 -10 -100 1000
567888

Resources

2018 UESTC ACM Training for Search Algorithm and String