Problem: Vegetable Market

A gardener is selling his harvest on the vegetable market. He is selling vegetables for N levs per kilogram and fruits for M levs per kilogram. Write a program that calculates the earnings of the harvest in euro (if one euro equals 1.94 lv.)

Input Data

Four numbers are read from the console, one per line:

  • First line - Price per kilogram for vegetables - a floating-point number.
  • Second line - Price per kilogram for fruits - a floating-point number.
  • Third line - Total kilograms of vegetables - an integer.
  • Fourth line - Total kilograms of fruits - an integer.

Constraints: All numbers will be in the interval between 0.00 and 1000.00

Output Data

Print on the console one floating-point number: the earnings of all fruits and vegetables in euro.

Sample Input and Output

Input Output
0.194
19.4
10
10
101

Clarification for the first example:

  • Vegetables cost: 0.194 lv. * 10 kg. = 1.94 lv.
  • Fruits cost: 19.4 lv. * 10 kg. = 194 lv.
  • Total: 195.94 lv. = 101 euro.
Input Output
1.5
2.5
10
10
20.6185567010309

results matching ""

    No results matching ""