PROG0076 - Sending a parcel

no tags 

Preparation

For this assignment you will need functions from the math module. You can find more information about this in your text book on page 67 and 68. Also, try the interactive session underneath in the Python shell. The first command imports the math module, so it can be used. The second command shows the help information about the math module. You can go through this document with the space bar. You can close the document by pressing Q. Once you find the correct function, you can ask for more information about it as is demonstrated in the function pow.

>>> import math
>>> help(math)
>>> help(math.pow)

Assignment

When sending parcels, the tariff is calculated as follows:
The weight in kilograms of the parcel is first rounded up, so that it becomes a whole number. For a parcel of two kilograms or less, you pay a standard fee of $s$ euros. For every extra kilogram (on top of the maximum of two kilograms), an extra fee of $t$ euros per kilogram is charged.

Input

The value of $s$ and $t$ (in euros) and the weight of a parcel (in kilograms). In this order on separate lines.

Output

The total cost to send the parcel given.

Example

Input:

1.99
1.42
666.01

Output:

946.29

Voorbereiding

Bij deze opgave zal je functies uit de math module nodig hebben. Je vindt hierover meer informatie in het handboek op pagina 67 en 68. Probeer alvast ook onderstaande interactieve sessie eens uit te voeren in de Python shell. Het eerste commando importeert de math module zodat die daarna kan gebruikt worden. Het tweede commando toont de help-informatie over de math module. Met behulp van de spatiebalk kan je dit document overlopen en op het einde sluit je het af door op Q te drukken. Wanneer je de juiste functie gevonden hebt, kan je daarover meer informatie opvragen zoals gedemonstreerd is voor de functie pow.

>>> import math
>>> help(math)
>>> help(math.pow)

Opgave

Bij het versturen van een postpakket wordt het tarief op de volgende manier berekend. Het gewicht in kilogram van een postpakket wordt eerst naar boven afgerond, zodat het een geheel getal wordt. Voor een postpakket van twee kilogram of minder betaalt men het standaardbedrag van $s$ euro. Voor elke kilogram extra (bovenop de limiet van twee kilogram) wordt er een bijkomend bedrag van $t$ euro per kilogram aangerekend.

Invoer

De waarden van $s$ en $t$ (in euro) en het gewicht van een postpakket (in kilogram) in die volgorde en op afzonderlijke regels.

Uitvoer

De totale kost om het gegeven postpakket te verzenden.

Voorbeeld

Invoer:

1.99
1.42
666.01

Uitvoer:

946.29


Added by:Peter Dawyndt
Date:2011-08-01
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:PY_NBC
Resource:None