#K54632. Minimum Registration Cost
Minimum Registration Cost
Minimum Registration Cost
You are given a number of students M. They must be divided into teams such that each team can hold at most K students. Each team registration costs Y dollars. To ensure that no student is left behind, you must form enough teams to cover all M students. The minimum number of teams required is calculated as \(\lceil \frac{M}{K} \rceil\). Your task is to compute the minimum total cost necessary for registering the teams for each test case.
inputFormat
The first line contains an integer T representing the number of test cases. Each of the following T lines contains three space-separated integers: M (the total number of students), K (the maximum number of students per team), and Y (the registration cost per team).
outputFormat
For each test case, output a single line containing the minimum total registration cost.## sample
3
5 3 200
15 4 150
7 2 100
400
600
400
</p>