title: Find Minimum Number Divided Make Number Perfect Square
signature: func findMinimumNumberDividedMakeNumberPerfectSquare(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(95, 95)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(48, 3)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(3, 3)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(10, 10)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(82, 82)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(1, 1)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(77, 77)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(99, 11)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(23, 23)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(61, 61)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def find_minimum_number_divided_make_number_perfect_square(n):
      count = 0
      ans = 1
      while ((n % 2) == 0):
          count += 1
          n //= 2
      if ((count % 2) is not 0):
          ans *= 2
      for i in range(3, (int(math.sqrt(n)) + 1), 2):
          count = 0
          while ((n % i) == 0):
              count += 1
              n //= i
          if ((count % 2) is not 0):
              ans *= i
      if (n > 2):
          ans *= n
      return ans
source_cpp: int find_minimum_number_divided_make_number_perfect_square(int n) {
    int count = 0, ans = 1;
    while ( n % 2 == 0 ) {
      count ++;
      n /= 2;
    }
    if ( count % 2 ) ans *= 2;
    for ( int i = 3;
    i <= sqrt ( n );
    i += 2 ) {
      count = 0;
      while ( n % i == 0 ) {
        count ++;
        n /= i;
      }
      if ( count % 2 ) ans *= i;
    }
    if ( n > 2 ) ans *= n;
    return ans;
  }