A gas station is selling fuel with the following discount table:
- Diesel:
- Up to 20 liters.
- 3% discount per liter over 20 liters.
- 5% discount per liter.
- Gasoline:
- Up to 20 liters.
- 4% discount per liter over 20 liters.
- 6% discount per liter.
Write an algorithm that reads the number of liters sold, the type of fuel (coded as follows: D-diesel, G-gasoline), calculates and prints the amount to be paid by the customer knowing that the price of a liter of Gasoline is CAD$ 2.50 the price of a liter of Diesel is CAD$ 1.90.