#K92617. Final Plant Heights
Final Plant Heights
Final Plant Heights
You are given a series of test cases, each representing a set of plants. For each test case, the first line contains two integers n and t where:
- n is the number of plant types.
- t is the number of days.
Each test case is followed by n lines, each containing two integers h and g, which denote the initial height and growth rate of a plant respectively. The final height of each plant is calculated using the formula: $$h + g\times t$$
The input terminates with a test case where both n and t are zero; this test case should not be processed.
inputFormat
The input consists of multiple test cases. Each test case begins with a line containing two space-separated integers n and t. If n = 0 and t = 0, it marks the end of input and should not be processed.
If n > 0, then 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 test case, output a single line containing the final heights of all plants, separated by a single space. The final height of a plant is computed as h + g × t using the formula: $$h + g\times t$$.
## sample3 10
5 2
3 1
8 0
2 5
1 3
2 1
0 0
25 13 8
16 7
</p>