title: Count Number Pairs N B N Gcd B B
signature: class Solution {
  
      public Double countNumberPairsNBNGcdBB(Integer n) {
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.extension: java
question_info.entry_fn_name: countNumberPairsNBNGcdBB
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(17, 58.47239288489289);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(72, 349.9783310569835);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(43, 187.0499406858786);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(55, 252.6486716559348);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(62, 291.1683590456309);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(22, 81.19789150478006);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(17, 58.47239288489289);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(68, 326.67596370158344);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(20, 71.95479314287363);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(29, 114.88796013002468);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__