Company: Intuit_8feb
Difficulty: medium
Louie and Pairs Problem Description Louie wants to determine the number of ordered pairs (x, y) such that 1 <= x <= bound_x and 1 <= y <= bound_y , and the following expression has an integer value: (sqrt(x) + sqrt(y))^2 Here sqrt is the exact (real) square root. (inferred - the source says "has an integer value"; this means the exact mathematical value is an integer, with no rounding or floating-point tolerance.) Note: pairs (1, 2) and (2, 1) are different, so they should be considered twice in the final answer. A pair with x = y is counted once. Implement the function solve(bound_x, bound_y) , which returns the number of such ordered pairs. Input Format The first line of input contains an integer bound_x . The second line of input contains an integer bound_y . Output Format Print a single integer: the number of ordered pairs (x, y) for which (sqrt(x) + sqrt(y))^2 has an integer value. (inferred - the source says only "the number of ordered pairs"; it is printed on one lin