ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Арифметика > задача:


50814 - Buying Books from Internet

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50521 - Pound to Grams
• 50292 - Average of 4 Marks
• 50432 - Numbers and Squares
• 50510 - What floor are they?
• 50870 - ZScore normalization
• 50797 - Nr of Missing Guests
• 50518 - Histogram Equalization
• 50522 - Multiplication Table - 2
• 50814 - Buying Books from Inte...
• 50812 - Total Discount for the clients
• 51003 - Double Prime
• 50435 - City Electric Bills
• 50527 - Sum of LCMs
• 50440 - Call Center
• 50342 - 100 Factorial
• 50439 - Telephone Calls
• 50436 - Pocket Money

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Buying Books from Internet

You want to buy books from internet. The companies offer different prices for the books and for shipping. They also offer different shipping price if you order more than one copies.

Question: Read the information for n orders and calculate total price to pay.

Input specification
First you will be given the number of orders (n) where n is between 0 and 5000. Then, in the following n lines you will be given information for n orders. Each order information contains four numbers

  1. The number of books: an integer between 1 and 10.
  2. Price of a book: a floating point number between 1 and 25.
  3. Shipping price for one book: a floating point number between 1 and 15
  4. Shipping price for multiple copies: a floating point number between 1 and 10

Output specification
Show one floating point number with two digits precision.

Sample Input
3
2 5.5 3 2
1 5.4 7.1 5.1
2 7.5 3.5 2
Sample Output
46.50

Explanation:

  • The first book has been ordered 2 copies: (5.5*2) + (2*2) = 15
  • The second book has been ordered only one copy: (5.4) + (7.1) = 12.5
  • The third book has been ordered 2 copies: (7.5*2) + (2*2) = 19
And the total is (15 + 12.5 + 19) 46.50



Для отправки решений необходимо выполнить вход.

www.contester.ru