static long max_gcd ( long n , long p ) {
  int count = 0 ;
  long gcd = 1 ;
  while ( p % 2 == 0 ) {
    p >>= 1 ;
    count ++ ;
  }
  if ( count > 0 ) gcd *= ( long ) Math . pow ( 2 , count / n ) ;
  for ( long i = 3 ;
  i <= Math . sqrt ( p ) ;
  i += 2 ) {
    count = 0 ;
    while ( p % i == 0 ) {
      count ++ ;
      p = p / i ;
    }
    if ( count > 0 ) {
      gcd *= ( long ) Math . pow ( i , count / n ) ;
    }
  }
  if ( p > 2 ) gcd *= ( long ) Math . pow ( p , 1 / n ) ;
  return gcd ;
}

static long max_gcd ( long n , long p ) { int count = 0 ; long gcd = 1 ; while ( p % 2 == 0 ) { p >>= 1 ; count ++ ; } if ( count > 0 ) gcd *= ( long ) Math . pow ( 2 , count / n ) ; for ( long i = 3 ; i <= Math . sqrt ( p ) ; i += 2 ) { count = 0 ; while ( p % i == 0 ) { count ++ ; p = p / i ; } if ( count > 0 ) { gcd *= ( long ) Math . pow ( i , count / n ) ; } } if ( p > 2 ) gcd *= ( long ) Math . pow ( p , 1 / n ) ; return gcd ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) update: (assignment_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: (binary_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (decimal_integer_literal) right: (identifier)))))))) (return_statement (identifier))))