#K8686. Final Height of Plants

    ID: 36958 Type: Default 1000ms 256MiB

Final Height of Plants

Final Height of Plants

You are given N plants in a garden. Each plant has an initial height H and a growth rate G. After M months, the height of a plant is computed by the formula:

\( H + M \times G \)

Your task is to calculate and output the final height of each plant after the given number of months.

inputFormat

The input is read from stdin and has the following format:

  • The first line contains two space-separated integers: N (the number of plants) and M (the number of months).
  • The following N lines each contain two space-separated integers: the initial height H and the growth rate G of a plant.

outputFormat

For each plant, print its final height on a new line to stdout.

## sample
3 2
10 5
15 3
20 2
20

21 24

</p>