#C2390. Minimum Discounted Price

    ID: 45701 Type: Default 1000ms 256MiB

Minimum Discounted Price

Minimum Discounted Price

You are given several test cases. In each test case, there are several phone models. For each model, you are provided with its base price and a set of configurations. Each configuration includes a RAM size and a discount percentage. Your task is to compute the minimum price of the phone for each model after applying the discount. The discounted price for a configuration is calculated using the formula: (P = B \times \Bigl(1 - \frac{d}{100}\Bigr)), where (B) is the base price and (d) is the discount percentage. You should output the minimum discounted price for each phone model in the order they appear.

inputFormat

The input is read from standard input. The first line contains an integer (T), the number of test cases. For each test case, the first line contains an integer (N), the number of phone models in that test case. Then, for each phone model, there is a line containing two integers: the base price (B) and the number of configurations (M). This is followed by (M) lines, each containing two integers representing the RAM size (which can be ignored for the price calculation) and the discount percentage.

outputFormat

For each phone model (across all test cases), output its minimum discounted price on a separate line. The output should be written to standard output.## sample

2
1
1000 3
4 20
6 15
8 25
2
1500 2
4 10
8 20
2000 3
6 5
8 12
12 8
750

1200 1760

</p>