#K51427. Water Flow Adjustment

    ID: 29085 Type: Default 1000ms 256MiB

Water Flow Adjustment

Water Flow Adjustment

Given the current temperature T (in degrees Celsius), the hour of the day H (in 24-hour format), and the initial water flow rate W (in liters per minute), you are required to calculate the final water flow rate. The adjustments are made as follows:

  • If the temperature T is greater than 30°C, the water flow rate is doubled.
  • If the hour H is between 6 and 18 (inclusive), the water flow rate is further increased by 50% (i.e. multiplied by 1.5). Note that if both conditions apply, the multiplication factors are applied sequentially: first doubling (if T > 30) then increasing by 50% (if 6 ≤ H ≤ 18).
  • If neither condition applies, the water flow rate remains unchanged.

Your task is to compute and output the final water flow rate as an integer.

Note: When increasing by 50%, the result is truncated to an integer. Use the operation ⌊W × 1.5⌋.

inputFormat

The input consists of a single line containing three space-separated integers: T, H, and W.

  • T: Temperature in degrees Celsius.
  • H: Hour of the day (0 ≤ H ≤ 23).
  • W: Initial water flow rate in liters per minute.

outputFormat

Output a single integer representing the final water flow rate after applying the corresponding adjustments.

## sample
32 14 100
300