Horseshoe
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Zenyk and Marichka have a farm with \(n\) stallions. It is time for the horses to replace theirhorseshoes.
At the market, horseshoes are not sold individually, but only in boxes — each box contains \(k\) horseshoes. One box costs \(c\) UAH. Each horse requires four horseshoes.
Zenyk is about to go to the market to buy horseshoes, but he does not know how much money to take with him.
Calculate the minimum amount of money Zenyk must spend to buy horseshoes for all his stallions.
Input
A single line contains three integers \(n\), \(k\), \(c\) — the number of stallions on the farm, the number of horseshoes in one box, and the price of one box in hryvnias.
Output
Output an integer — the minimum amount of money (in hryvnias) Zenyk must spend on horseshoes for the horses.
You should output to the standard output stream (console). Your
output must strictly match the problem requirements. No additional data
should be outputted. For example, if you output something like
Enter n, k, c: before reading the numbers, or
Answer for the problem: before printing the answer, you
will get the Wrong Answer verdict.
Constraints
\(1 \le n, k, c \le 100\).
Evaluation consists of the following blocks:
1 point for each example from the problem statement,
62 points: \(k = 1\),
36 points: no additional constraints.
You will receive the points for a block only if your solution passes all tests in that block.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 7 47 | 141 |
| Input (stdin) | Output (stdout) |
|---|---|
| 7 4 74 | 518 |
Notes
In the first example, there are four stallions, each needs four horseshoes — a total of \(16\) horseshoes. There are seven horseshoes in one box. A box costs \(47\) UAH. If Zenyk buys two boxes, he will have \(14\) horseshoes — this is not enough for all horses. If he buys three boxes, he will have \(21\) horseshoes, which is enough for four horses. Therefore, Zenyk must buy three boxes. He needs to take \(3 \cdot 47 = 141\) (UAH) with him.
In the second example, he needs to buy seven boxes of horseshoes — one box for each stallion. Then the answer to the problem is \(7 \cdot 74 = 518\) (UAH).
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|