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

Сборники > Фёдор Меньшиков. Тренировки > задача:


50814 - Buying Books from Internet

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

Задачи сборника

• 50952 - Derby Tirana
• 50807 - Euro to Leke
• 50871 - Harmonic Mean
• 50859 - Low performance
• 50508 - The Biggest Area
• 50528 - Rock-Scissors-Paper
• 50744 - The Smallest Perimeter
• 50808 - Total Distance Traveled
• 50814 - Buying Books from Inte...
• 50812 - Total Discount for the clients
• 50832 - Rock Paper Scissors Lizard ...
• 51078 - Max trade
• 51077 - Grades Histogram
• 51046 - The biggest number
• 50867 - Average of the Best Grades
• Reflektimi i pikes
• 50994 - The Most Crowded Station

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

Если у вас есть предложения или пожелания по работе 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