| ||A quadruplet of non-negative integers (a,b,c,d) is called a divisor quadruplet if there exists at least one positive integer N that satisfies the following four conditions:
You are given longs A, B, C and D. Return the number of divisor quadruplets (a,b,c,d) such that A contains a, B contains b, C contains c and D contains d.
- N has exactly a divisors x such that x ≡ 0 (mod 4).
- N has exactly b divisors x such that x ≡ 1 (mod 4).
- N has exactly c divisors x such that x ≡ 2 (mod 4).
- N has exactly d divisors x such that x ≡ 3 (mod 4).
|Parameters:||long, long, long, long|
|Method signature:||int countQuadruplets(long A, long B, long C, long D)|
|(be sure your method is public)|
|-||x ≡ k (mod 4) means (x - k) is divisible by 4.|
|-||A, B, C and D will contain between 1 and 50 integers, inclusive.|
|-||Each element of A, B, C and D will be between 0 and 1,000,000,000,000,000,000 (10^18), inclusive.|
|-||A, B, C and D will contain no duplicate elements.|
|(1, 1, 1, 0) is a divisor quadruplet because N = 4 satisfies the conditions.|
|All integers have at least one divisor.|
|(0, 0, 0, 0) is not a divisor quadruplet. (0, 1, 0, 0) is a divisor quadruplet.|