static int findInt ( int n , int m ) {
  int minDigit = ( int ) Math . floor ( ( double ) ( m / 9 ) ) ;
  int start = ( int ) Math . pow ( 10 , minDigit ) - ( int ) Math . pow ( 10 , minDigit ) % n ;
  while ( start < Integer . MAX_VALUE ) {
    if ( digitSum ( start ) == m ) return start ;
    else start += n ;
  }
  return - 1 ;
}

static int findInt ( int n , int m ) { int minDigit = ( int ) Math . floor ( ( double ) ( m / 9 ) ) ; int start = ( int ) Math . pow ( 10 , minDigit ) - ( int ) Math . pow ( 10 , minDigit ) % n ; while ( start < Integer . MAX_VALUE ) { if ( digitSum ( start ) == m ) return start ; else start += n ; } return - 1 ; }
(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: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier)))) right: (binary_expression left: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier)))) right: (identifier))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier))) right: (identifier))) consequence: (return_statement (identifier)) alternative: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))