title: Count Number Pairs N B N Gcd B B
signature: fun countNumberPairsNBNGcdBB(n: Int): Double {
source_py: def count_number_pairs_n_b_n_gcd_b_b(n):
      k = n
      imin = 1
      ans = 0
      while (imin <= n):
          imax = (n / k)
          ans += (k * ((imax - imin) + 1))
          imin = (imax + 1)
          k = (n / imin)
      return ans
source_cpp: int count_number_pairs_n_b_n_gcd_b_b(int n) {
    int k = n;
    int imin = 1;
    int ans = 0;
    while ( imin <= n ) {
      int imax = n / k;
      ans += k * ( imax - imin + 1 );
      imin = imax + 1;
      k = n / imin;
    }
    return ans;
  }
question_info.test_list: [{"idx": 0, "outputs": 58.47239288489289, "inputs": {"n": 17}}, {"idx": 1, "outputs": 349.9783310569835, "inputs": {"n": 72}}, {"idx": 2, "outputs": 187.0499406858786, "inputs": {"n": 43}}, {"idx": 3, "outputs": 252.6486716559348, "inputs": {"n": 55}}, {"idx": 4, "outputs": 291.1683590456309, "inputs": {"n": 62}}, {"idx": 5, "outputs": 81.19789150478006, "inputs": {"n": 22}}, {"idx": 6, "outputs": 58.47239288489289, "inputs": {"n": 17}}, {"idx": 7, "outputs": 326.67596370158344, "inputs": {"n": 68}}, {"idx": 8, "outputs": 71.95479314287363, "inputs": {"n": 20}}, {"idx": 9, "outputs": 114.88796013002468, "inputs": {"n": 29}}]
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:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(n: Int, expected:Double):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(17, 58.47239288489289)
      println("TEST-0...${result}")
      
      result = driver(72, 349.9783310569835)
      println("TEST-1...${result}")
      
      result = driver(43, 187.0499406858786)
      println("TEST-2...${result}")
      
      result = driver(55, 252.6486716559348)
      println("TEST-3...${result}")
      
      result = driver(62, 291.1683590456309)
      println("TEST-4...${result}")
      
      result = driver(22, 81.19789150478006)
      println("TEST-5...${result}")
      
      result = driver(17, 58.47239288489289)
      println("TEST-6...${result}")
      
      result = driver(68, 326.67596370158344)
      println("TEST-7...${result}")
      
      result = driver(20, 71.95479314287363)
      println("TEST-8...${result}")
      
      result = driver(29, 114.88796013002468)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: countNumberPairsNBNGcdBB
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