static int minPerfectSquare ( int arr [ ] , int n ) {
  int minPerfectSq ;
  int lcm = lcmOfArray ( arr , n ) ;
  minPerfectSq = ( int ) lcm ;
  int cnt = 0 ;
  while ( lcm > 1 && lcm % 2 == 0 ) {
    cnt ++ ;
    lcm /= 2 ;
  }
  if ( cnt % 2 != 0 ) minPerfectSq *= 2 ;
  int i = 3 ;
  while ( lcm > 1 ) {
    cnt = 0 ;
    while ( lcm % i == 0 ) {
      cnt ++ ;
      lcm /= i ;
    }
    if ( cnt % 2 != 0 ) minPerfectSq *= i ;
    i += 2 ;
  }
  return minPerfectSq ;
}

static int minPerfectSquare ( int arr [ ] , int n ) { int minPerfectSq ; int lcm = lcmOfArray ( arr , n ) ; minPerfectSq = ( int ) lcm ; int cnt = 0 ; while ( lcm > 1 && lcm % 2 == 0 ) { cnt ++ ; lcm /= 2 ; } if ( cnt % 2 != 0 ) minPerfectSq *= 2 ; int i = 3 ; while ( lcm > 1 ) { cnt = 0 ; while ( lcm % i == 0 ) { cnt ++ ; lcm /= i ; } if ( cnt % 2 != 0 ) minPerfectSq *= i ; i += 2 ; } return minPerfectSq ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))