Deloitte | OA | Points Satisfying Given Conditions
Anonymous User
245

Points Satisfying Given Conditions

Given the equation f(x, y) = x^2 + 5xy + 3y^2 and an integer N, count the number of points (x, y) which satisfies the following conditions:

  • x and y must be co primes.
  • On substituting the x and y values in the equation resultant value must be less th N.
  • The result of the equation after substituting x and y value must be a perfect square.

Example:

Input: N = 10
Output: 1
Explanation: (1, 1) is the only point which satifies all of the given conditions.

Constraints:

  • 1 <= N <= 10000
Comments (4)