#C5112. Highest Weighted Score
Highest Weighted Score
Highest Weighted Score
You are given a series of test cases, where each test case contains several reviews. Each review has two integers: a rating (R_i) and upvotes (A_i). The weighted score of a review is calculated as (score = R_i \times A_i). Your task is to determine the highest weighted score for each test case.
For example, in a test case with reviews: (4, 10)
, (1, 20)
, and (3, 15)
, the scores are (40, 20, 45) respectively, so the answer is 45
.
inputFormat
The first line of input contains an integer (T) indicating the number of test cases. For each test case, the first line contains an integer (N) denoting the number of reviews. The next (N) lines each contain two integers (R_i) and (A_i), separated by a space.
outputFormat
For each test case, output a single integer representing the highest weighted score among the reviews. Each answer should be on a new line.## sample
2
3
4 10
1 20
3 15
2
8 5
7 9
45
63
</p>