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

Разделы > Поиск > задача:


50458 - Weekly Report

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

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

• 50570 - Numrat prim ne segmentin[...
• 50586 - Palindrome te thjeshta
• 50783 - Numri me i vogel
• Raporti Javor
• 50331 - Number of Numbers over A...
• 50465 - How many students have p...
• 50450 - Last Appereance of a Number
• 50378 - Sum of the given digits
• 50458 - Weekly Report
• 50589 - Numri i vezeve te shitura
• 50792 - Studenti me mesataren me...
• 50558 - Hangari i madh [USACO FA...

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

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