public static int solve ( int a , int [ ] l1 , int [ ] l2 , int ind , int n , int l ) {
  if ( ind == l ) {
    if ( a >= n ) return a ;
    else return 1000000007 ;
  }
  else {
    int min = 1000000007 ;
    for ( int i = 0 ;
    i <= l2 [ ind ] ;
    i ++ ) {
      min = Math . min ( solve ( a * ( int ) Math . pow ( l1 [ ind ] , i ) , l1 , l2 , ind + 1 , n , l ) , min ) ;
    }
    return min ;
  }
}

public static int solve ( int a , int [ ] l1 , int [ ] l2 , int ind , int n , int l ) { if ( ind == l ) { if ( a >= n ) return a ; else return 1000000007 ; } else { int min = 1000000007 ; for ( int i = 0 ; i <= l2 [ ind ] ; i ++ ) { min = Math . min ( solve ( a * ( int ) Math . pow ( l1 [ ind ] , i ) , l1 , l2 , ind + 1 , n , l ) , min ) ; } return min ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (identifier)) alternative: (return_statement (decimal_integer_literal)))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))))) (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier))) (identifier))))))) (return_statement (identifier))))))