Problems
10005 - The Sky Chef
SUBMIT PROBLEM

The Sky Chef

Time Limit: 1 sec

 

The Problem

Aminur Rashid went to The Sky Chef (a well renowned restaurant at 4/A Dhanmondi Dhaka) for his dinner. He placed an order of three food items. He requested for discount to cashier and cashier gave him some discount. But after getting the bill, Aminur became confused as given bill was not the same as his assumed bill.

 

The total price of three items was 100.00 BDT. Aminur got 10% discount and he never forgot about 15% VAT. So he calculated the bill as:

 

100.00 BDT + 15% Vat = 115.00 BDT (Amount with VAT)

115.00 BDT - 10% Discount = 103.50 BDT (Amount needed to pay)

 

But given bill was 105.00 Tk. After seeing this, Aminur wanted explanation about the bill. Cashier said “Discount cannot be applied on amount with VAT”. And show the calculation as below:

 

100.00 BDT + 15% Vat = 115.00 BDT (Amount with VAT)

10% of 100.00 BDT = 10.00 BDT (Amount of discount without VAT)

115.00 BDT – 10.00 BDT = 105.00 BDT (Amount needed to pay)

 

Now you have to write a program that calculates the bill according to cashier’s explanation.

 

The Input

Input file consists of several test cases. Each test case contains a line and each line contains 4 numbers A, B, C and D. A, B, C is the price of three items. D is the percentage of discount. Input is terminated by EOF, where 0 < A <= 10000, 0 < B<= 10000, 0 <C <= 10000 and 0 <= D <= 100. VAT is always 15%. 

 

The Output

For each test case, you have to printout the amount of bill rounded to two decimal places in a separate line.

 

Sample Input

20 30 50 10

40 60 100 20

 

Sample Output

105.00

190.00

 

 

 

[College Level]

Inter School & College Programming Contest (ISCPC) 2015 

Problem Setter: Md. Helal Uddin & Hasnayn Ahmed Shakil