title: Count Number Pairs N B N Gcd B B
signature: pub fn count_number_pairs_n_b_n_gcd_b_b(n: i32) -> f64 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: f64, expected: f64)->bool{
  return (actual - expected).abs() < 1e-09
  }
  pub fn driver(n: i32, expected: f64)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        17, 
        58.47239288489289
      ));
      
      println!("TEST-1...{}", driver(
        72, 
        349.9783310569835
      ));
      
      println!("TEST-2...{}", driver(
        43, 
        187.0499406858786
      ));
      
      println!("TEST-3...{}", driver(
        55, 
        252.6486716559348
      ));
      
      println!("TEST-4...{}", driver(
        62, 
        291.1683590456309
      ));
      
      println!("TEST-5...{}", driver(
        22, 
        81.19789150478006
      ));
      
      println!("TEST-6...{}", driver(
        17, 
        58.47239288489289
      ));
      
      println!("TEST-7...{}", driver(
        68, 
        326.67596370158344
      ));
      
      println!("TEST-8...{}", driver(
        20, 
        71.95479314287363
      ));
      
      println!("TEST-9...{}", driver(
        29, 
        114.88796013002468
      ));
      
  }
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;
  }