static boolean checkArray ( int arr [ ] , int prime [ ] , int n , int m ) {
  int lcm = lcmOfArray ( arr , n ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    int val = lcm / arr [ i ] ;
    for ( int j = 0 ;
    j < m && val != 1 ;
    j ++ ) while ( val % prime [ j ] == 0 ) val = val / prime [ j ] ;
    if ( val != 1 ) return false ;
  }
  return true ;
}

static boolean checkArray ( int arr [ ] , int prime [ ] , int n , int m ) { int lcm = lcmOfArray ( arr , n ) ; for ( int i = 0 ; i < n ; i ++ ) { int val = lcm / arr [ i ] ; for ( int j = 0 ; j < m && val != 1 ; j ++ ) while ( val % prime [ j ] == 0 ) val = val / prime [ j ] ; if ( val != 1 ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (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: (method_invocation name: (identifier) arguments: (argument_list (identifier) (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) right: (decimal_integer_literal))) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (false))))) (return_statement (true))))