Euler discovered the formula n^2 + n + 41 produces primes for n = 0 to 39. Another formula n^2 - 79n + 1601 produces primes for 80 consecutive values of n. Consider quadratics of the form n^2 + an + b, where |a| < A and |b| <= B. Find the product a * b for the quadratic that produces the maximum number of primes for consecutive values of n, starting from n = 0. Input format: two space-separated integers: A B
Example 1:
Example 2:
Example 3:
Constraints:
1 <= A, B <= 1000
Tags:
