#K67547. Maximum Jet Heights

    ID: 32666 Type: Default 1000ms 256MiB

Maximum Jet Heights

Maximum Jet Heights

You are given a set of jets, each with an initial height and a fixed height increment. Every time a jet is activated, its height increases by its respective increment. Given the number of activations, compute the maximum height each jet can achieve.

The mathematical formula for the maximum height of the i-th jet is given by:

\( H_i = h_i + n \times d_i \)

where \( h_i \) is the initial height, \( d_i \) is the fixed increment, and \( n \) is the number of activations.

For example, if there are 4 jets with initial heights of [3, 7, 2, 5], increments [2, 1, 3, 2] and n = 4 activations, then the maximum heights will be [11, 11, 14, 13].

inputFormat

The input is provided through standard input (stdin) and consists of four lines:

  1. The first line contains an integer \( m \) representing the number of jets.
  2. The second line contains \( m \) space-separated integers representing the initial heights of the jets.
  3. The third line contains \( m \) space-separated integers representing the fixed height increments for each jet.
  4. The fourth line contains an integer \( n \) representing the number of activations.

outputFormat

Output a single line to standard output (stdout) containing \( m \) integers separated by spaces. Each integer represents the maximum height of the corresponding jet after \( n \) activations.

## sample
4
3 7 2 5
2 1 3 2
4
11 11 14 13