title: Count Distinct Non Negative Pairs X Y Satisfy Inequality Xx Yy N 2
signature: fun countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2(n: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 54, "inputs": {"n": 61}}, {"idx": 1, "outputs": 41, "inputs": {"n": 45}}, {"idx": 2, "outputs": 50, "inputs": {"n": 53}}, {"idx": 3, "outputs": 4, "inputs": {"n": 4}}, {"idx": 4, "outputs": 73, "inputs": {"n": 82}}, {"idx": 5, "outputs": 79, "inputs": {"n": 86}}, {"idx": 6, "outputs": 35, "inputs": {"n": 37}}, {"idx": 7, "outputs": 43, "inputs": {"n": 48}}, {"idx": 8, "outputs": 71, "inputs": {"n": 81}}, {"idx": 9, "outputs": 45, "inputs": {"n": 50}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(61, 54)
      println("TEST-0...${result}")
      
      result = driver(45, 41)
      println("TEST-1...${result}")
      
      result = driver(53, 50)
      println("TEST-2...${result}")
      
      result = driver(4, 4)
      println("TEST-3...${result}")
      
      result = driver(82, 73)
      println("TEST-4...${result}")
      
      result = driver(86, 79)
      println("TEST-5...${result}")
      
      result = driver(37, 35)
      println("TEST-6...${result}")
      
      result = driver(48, 43)
      println("TEST-7...${result}")
      
      result = driver(81, 71)
      println("TEST-8...${result}")
      
      result = driver(50, 45)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn