

実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 200 点
問題文
N 匹のヘビがいます。
はじめ、i 匹目のヘビの太さは T_i、長さは L_i です。
ヘビの重さは太さと長さの積となります。
1 \leq k \leq D を満たす各整数 k について、すべてのヘビの長さが k 伸びたときの最も重いヘビの重さを求めてください。
制約
- 1 \leq N, D \leq 100
- 1 \leq T_i, L_i \leq 100
- 入力される値はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
N D T_1 L_1 T_2 L_2 \vdots T_N L_N
出力
D 行出力せよ。k 行目には、すべてのヘビの長さが k 伸びたときの最も重いヘビの重さを出力せよ。
入力例 1
4 3 3 3 5 1 2 4 1 10
出力例 1
12 15 20
すべてのヘビの長さが 1 伸びたとき、ヘビの重さはそれぞれ 12, 10, 10, 11 となるので 1 行目には 12 を出力します。
すべてのヘビの長さが 2 伸びたとき、ヘビの重さはそれぞれ 15, 15, 12, 12 となるので 2 行目には 15 を出力します。
すべてのヘビの長さが 3 伸びたとき、ヘビの重さはそれぞれ 18, 20, 14, 13 となるので 3 行目には 20 を出力します。
入力例 2
1 4 100 100
出力例 2
10100 10200 10300 10400
Score : 200 points
Problem Statement
There are N snakes.
Initially, the thickness of the i-th snake is T_i, and its length is L_i.
The weight of a snake is defined as the product of its thickness and length.
For each integer k satisfying 1 \leq k \leq D, find the weight of the heaviest snake when every snake's length has increased by k.
Constraints
- 1 \leq N, D \leq 100
- 1 \leq T_i, L_i \leq 100
- All input values are integers.
Input
The input is given from Standard Input in the following format:
N D T_1 L_1 T_2 L_2 \vdots T_N L_N
Output
Print D lines. The k-th line should contain the weight of the heaviest snake when every snake's length has increased by k.
Sample Input 1
4 3 3 3 5 1 2 4 1 10
Sample Output 1
12 15 20
When every snake’s length has increased by 1, the snakes' weights become 12, 10, 10, 11, so print 12 on the first line.
When every snake’s length has increased by 2, the snakes' weights become 15, 15, 12, 12, so print 15 on the second line.
When every snake’s length has increased by 3, the snakes' weights become 18, 20, 14, 13, so print 20 on the third line.
Sample Input 2
1 4 100 100
Sample Output 2
10100 10200 10300 10400