#C13044. Calculate Total Water Requirements
Calculate Total Water Requirements
Calculate Total Water Requirements
In this problem, you are given two sets of data representing the area (in hectares) dedicated to various crops and the water requirement (in liters per hectare) for each crop. Your task is to compute the total water requirement for each crop by multiplying the respective area and water requirement. Formally, for a crop \(c\), if the area is \(A_c\) and the water requirement per hectare is \(W_c\), then the total water required is given by:
\(Total_c = A_c \times W_c\)
If a crop listed in the area data does not have a corresponding water requirement, your program should output an error message. The crops should be processed in the order they are provided in the input.
inputFormat
The input is read from standard input (stdin) and consists of the following:
- An integer \(n\) representing the number of crops in the area data.
- \(n\) lines follow, each containing a crop name (a string without spaces) and its area (an integer), separated by space.
- An integer \(m\) representing the number of entries for water requirements.
- \(m\) lines follow, each containing a crop name (a string without spaces) and its water requirement (an integer), separated by space.
You can assume that the crop names in the area data are provided in the desired order of output.
outputFormat
For each crop in the area data:
- If the crop has a corresponding water requirement, output a line with the crop name and its total water requirement (\(A_c \times W_c\)) separated by a space.
- If a water requirement for a crop is missing, output an error message in the format:
Water requirement for crop 'crop_name' is not found
(without quotes), and do not output further results.
The output should be written to standard output (stdout).
## sample3
wheat 50
rice 20
corn 40
3
wheat 400
rice 1200
corn 700
wheat 20000
rice 24000
corn 28000
</p>