#C9962. Maximum Friends Participation

    ID: 54113 Type: Default 1000ms 256MiB

Maximum Friends Participation

Maximum Friends Participation

You are given T test cases. In each test case, you will receive three integers: F, C, and S, which denote the total number of friends, the number of cars available, and the seating capacity of each car respectively.

The task is to determine the maximum number of friends that can join the trip. Since each car can seat exactly S friends, the total seating capacity is
\(C \times S\).

Therefore, the answer for each test case is given by:

\(\min(F, C \times S)\)

Read input data from stdin and print the answer for each test case on a new line.

inputFormat

The input is given via standard input (stdin) and is formatted as follows:

  • The first line contains an integer T, the number of test cases.
  • Each of the next T lines contains three space-separated integers: F, C, and S.

outputFormat

For each test case, output a single integer on a new line representing the maximum number of friends that can participate in the trip.

## sample
3
10 2 6
13 3 5
5 1 5
10

13 5

</p>