title: Count Distinct Non Negative Pairs X Y Satisfy Inequality Xx Yy N 2
signature: countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2 :: Integer -> Integer
  countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2 n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (61) (54) )
  
      printf "TEST-1...%s\n" (driver (45) (41) )
  
      printf "TEST-2...%s\n" (driver (53) (50) )
  
      printf "TEST-3...%s\n" (driver (4) (4) )
  
      printf "TEST-4...%s\n" (driver (82) (73) )
  
      printf "TEST-5...%s\n" (driver (86) (79) )
  
      printf "TEST-6...%s\n" (driver (37) (35) )
  
      printf "TEST-7...%s\n" (driver (48) (43) )
  
      printf "TEST-8...%s\n" (driver (81) (71) )
  
      printf "TEST-9...%s\n" (driver (50) (45) )
  
source_py: def count_distinct_non_negative_pairs_x_y_satisfy_inequality_xx_yy_n_2(n):
      res = 0
      x = 0
      while ((x * x) < n):
          y = 0
          while (((x * x) + (y * y)) < n):
              res = (res + 1)
              y = (y + 1)
          x = (x + 1)
      return res
source_cpp: int count_distinct_non_negative_pairs_x_y_satisfy_inequality_xx_yy_n_2(int n) {
    int res = 0;
    for ( int x = 0;
    x * x < n;
    x ++ ) for ( int y = 0;
    x * x + y * y < n;
    y ++ ) res ++;
    return res;
  }