#K75812. Minimum Ingredient Sum

    ID: 34503 Type: Default 1000ms 256MiB

Minimum Ingredient Sum

Minimum Ingredient Sum

You are given T test cases. In each test case, you are given four integers M, P, Q, and R. The task is to calculate the minimum possible sum of the ingredient amounts used in a drink.

The minimum sum is determined by selecting the minimum amount for each ingredient. Mathematically, the sum is given by the formula $$P \times Q$$, where P is the number of ingredients chosen and Q is the minimum amount required for each ingredient.

Your job is to compute and output this sum for each test case.

inputFormat

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

T
M1 P1 Q1 R1
M2 P2 Q2 R2
... up to T test cases

Here, the first line contains an integer T representing the number of test cases. Each of the following T lines contains four space-separated integers: M, P, Q, and R.

outputFormat

For each test case, output a single integer on a new line which is the minimum possible sum computed using the formula $$P \times Q$$.

## sample
1
5 3 1 5
3

</p>