3+1
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Today Zenyk and Marichka are having guests, so Zenyk ordered 4 pizzas at his favorite pizzeria.
This pizzeria has a "3+1" promotion — the cheapest of the four pizzas is free. Help Zenyk calculate how much he has to pay.
Input
The single line contains 4 integers — the cost in hryvnias of each pizza.
Output
Output a single number — how many hryvnias Zenyk has to pay for the pizza.
Constraints
The cost of each pizza is from 100 to 1000 hryvnias.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 447 744 447 777 | 1968 |
Notes
In the example, the cost of one of the cheapest pizzas is 447. Then Zenyk has to pay \(447+744+777=1968\).
Source: The Algo Battles 2024 - Етап 1
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 |
|---|