public static void main ( String args [ ] ) throws IOException {
  int hour = sc . nextInt ( ) ;
  int min = sc . nextInt ( ) ;
  int hungerLevel = sc . nextInt ( ) ;
  int hunger_level_in = sc . nextInt ( ) ;
  int cost = sc . nextInt ( ) ;
  int hungerstop = sc . nextInt ( ) ;
  int buns = ( int ) Math . ceil ( ( double ) hungerLevel / ( double ) hungerstop ) ;
  double costOfAll = buns * cost ;
  double discountedCost = ( ( 0.8 ) * costOfAll ) ;
  double fianl = 0 ;
  int time = ( 60 * hour ) + min ;
  if ( time > 1200 ) System . out . println ( discountedCost ) ;
  else {
    int bunss = ( int ) Math . ceil ( ( double ) hungerLevel / ( double ) hungerstop ) ;
    double costOf = bunss * cost ;
    int bunsafter8 = ( int ) ( Math . ceil ( ( double ) ( hungerLevel + hunger_level_in * ( 1200 - time ) ) / ( double ) hungerstop ) ) ;
    double costAfter8 = ( bunsafter8 * cost * ( 0.8 ) ) ;
    fianl = Math . min ( costOf , costAfter8 ) ;
    System . out . println ( fianl ) ;
  }
}

public static void main ( String args [ ] ) throws IOException { int hour = sc . nextInt ( ) ; int min = sc . nextInt ( ) ; int hungerLevel = sc . nextInt ( ) ; int hunger_level_in = sc . nextInt ( ) ; int cost = sc . nextInt ( ) ; int hungerstop = sc . nextInt ( ) ; int buns = ( int ) Math . ceil ( ( double ) hungerLevel / ( double ) hungerstop ) ; double costOfAll = buns * cost ; double discountedCost = ( ( 0.8 ) * costOfAll ) ; double fianl = 0 ; int time = ( 60 * hour ) + min ; if ( time > 1200 ) System . out . println ( discountedCost ) ; else { int bunss = ( int ) Math . ceil ( ( double ) hungerLevel / ( double ) hungerstop ) ; double costOf = bunss * cost ; int bunsafter8 = ( int ) ( Math . ceil ( ( double ) ( hungerLevel + hunger_level_in * ( 1200 - time ) ) / ( double ) hungerstop ) ) ; double costAfter8 = ( bunsafter8 * cost * ( 0.8 ) ) ; fianl = Math . min ( costOf , costAfter8 ) ; System . out . println ( fianl ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (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)))) (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) 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: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (cast_expression type: (floating_point_type) value: (identifier)) right: (cast_expression type: (floating_point_type) value: (identifier)))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (parenthesized_expression (binary_expression left: (parenthesized_expression (decimal_floating_point_literal)) right: (identifier))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) alternative: (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 (binary_expression left: (cast_expression type: (floating_point_type) value: (identifier)) right: (cast_expression type: (floating_point_type) value: (identifier)))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))))))) right: (cast_expression type: (floating_point_type) value: (identifier))))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (parenthesized_expression (decimal_floating_point_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))