title: Count Distinct Non Negative Pairs X Y Satisfy Inequality Xx Yy N 2
signature: countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          61, 
          54)
      }");
  
      print("TEST-1...${driver(
          45, 
          41)
      }");
  
      print("TEST-2...${driver(
          53, 
          50)
      }");
  
      print("TEST-3...${driver(
          4, 
          4)
      }");
  
      print("TEST-4...${driver(
          82, 
          73)
      }");
  
      print("TEST-5...${driver(
          86, 
          79)
      }");
  
      print("TEST-6...${driver(
          37, 
          35)
      }");
  
      print("TEST-7...${driver(
          48, 
          43)
      }");
  
      print("TEST-8...${driver(
          81, 
          71)
      }");
  
      print("TEST-9...${driver(
          50, 
          45)
      }");
  
      return 0;
  }
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;
  }