#C10188. Maximum Seed Travel Distance
Maximum Seed Travel Distance
Maximum Seed Travel Distance
You are given a list of positive integers representing the maximum distance that a plant's seed can travel in a single generation. Additionally, you are provided with a non-negative integer indicating the number of generations. Your task is to calculate the maximum possible distance a seed can travel after the specified number of generations.
The maximum distance after generations is calculated by multiplying the maximum value in the list by the number of generations. In mathematical notation, if \(D\) is the set of distances and \(g\) is the number of generations, then the maximum travel distance is:
[ \text{distance} = \max(D) \times g ]
Note that if the number of generations is 0, the output should be 0.
inputFormat
The input is given in two lines through standard input (stdin):
- The first line contains one or more positive integers separated by spaces representing the maximum distances for each seed travel per generation.
- The second line contains a single non-negative integer representing the number of generations.
outputFormat
The output is a single integer written to standard output (stdout) representing the maximum possible distance a seed can travel after the given number of generations.
## sample1 2 3
0
0
</p>