title: Number Unique Rectangles Formed Using N Unit Squares
signature: func numberUniqueRectanglesFormedUsingNUnitSquares(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(34, 66)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(49, 104)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(41, 83)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(17, 28)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(67, 151)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(38, 76)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(59, 128)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(64, 144)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(61, 135)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(58, 127)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def number_unique_rectangles_formed_using_n_unit_squares(n):
      ans = 0
      for length in range(1, (int(math.sqrt(n)) + 1)):
          height = length
          while ((height * length) <= n):
              ans += 1
              height += 1
      return ans
source_cpp: int number_unique_rectangles_formed_using_n_unit_squares(int n) {
    int ans = 0;
    for ( int length = 1;
    length <= sqrt ( n );
    ++ length ) for ( int height = length;
    height * length <= n;
    ++ height ) ans ++;
    return ans;
  }