public static void process ( ) throws IOException {
  long n = sc . nextLong ( ) , g = sc . nextLong ( ) , b = sc . nextLong ( ) ;
  long req = n / 2 ;
  if ( n % 2 == 1 ) req ++ ;
  long l = 1 , r = Integer . MAX_VALUE ;
  long ans = 1 ;
  while ( l <= r ) {
    long mid = ( l + r ) / 2 ;
    if ( mid * g >= req ) {
      ans = mid ;
      r = mid - 1 ;
    }
    else {
      l = mid + 1 ;
    }
  }
  long res = b * ( ans - 1 ) ;
  res += ( ans - 1 ) * g ;
  req -= ( ( ans - 1 ) * g ) ;
  res += req ;
  long max = max ( res , n ) ;
  System . out . println ( max ) ;
}

public static void process ( ) throws IOException { long n = sc . nextLong ( ) , g = sc . nextLong ( ) , b = sc . nextLong ( ) ; long req = n / 2 ; if ( n % 2 == 1 ) req ++ ; long l = 1 , r = Integer . MAX_VALUE ; long ans = 1 ; while ( l <= r ) { long mid = ( l + r ) / 2 ; if ( mid * g >= req ) { ans = mid ; r = mid - 1 ; } else { l = mid + 1 ; } } long res = b * ( ans - 1 ) ; res += ( ans - 1 ) * g ; req -= ( ( ans - 1 ) * g ) ; res += req ; long max = max ( res , n ) ; System . out . println ( max ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_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 (update_expression (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (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: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))