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

Сборники > Kovrov IT > задача:


50458 - Weekly Report

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

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

• 50451 - Processing Cost
• 50751 - The biggest Minute
• 50468 - Draw Matrix - 2
• 50470 - Close Pairs - Revised
• 50998 - CEN112 Homework, quiz av...
• 50804 - Marathon
• 50835 - Club Presidency
• 50526 - Gold Market
• 50458 - Weekly Report
• 50872 - Top M Grades
• 50868 - Sort Frequencies
• 50405 - Accounts Receivable
• 50371 - Modified Karnaugh-Map
• 50908 - Buy 1 Get 1
• 50906 - The Smallest Pair
• 51043 - Genome Sequencing
• 51042 - The most frequent k-mer

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
50458 - IMPC13 - Group Contest 14-01-30.

Weekly Report

Mr. Alban Mataj has a supermarket. Whenever an item is sold through the chasier, its number is decreased automatically from the database. Time to time, to check his balance, he counts the items in the supermarket and prepares report.

Question:
Write a program that gets the number of items for this week followed by the price of each item. And then, it gets the number of items from the previous week. Then, the program calculates the number of total items sold and total amount of money got in that week.
Note:

Input specification
You will be given one integer number (n) at the beginning where 1 ≤ n ≤ 40000. Then, in the following n lines, you will be given two numbers, information about every item:

  • the number (count) of items this week (integer)
  • the price of this item (floating point number)
the following n lines give the previous count of items.

Output specification
Show two numbers (an integer number and a floating point number):

  • total items sold this week and
  • total revenue for this week

Note: Show total revenue with at most 2 digits precision after the floating point.

 Sample Input I   
  4
  5 2.2
  10 2
  9 1.2
  4 3
  10
  12
  15
  6
 Sample Input II   
  5
  19 2.8
  20 1.1
  10 1.9
  15 0.4
  19 2.1
  26
  26
  16
  23
  23
 Sample Output I   
  15 28.2
 Sample Output II   
  31 49.2

Explanation (Sample 1) : There are 4 items.

Item IDLast week This week Price NumSoldTotal
110 52.2 511
212 102 24
315 91.2 67.2
46 43 26
Для отправки решений необходимо выполнить вход.

www.contester.ru