HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Search > problem:


50458 - Weekly Report

Guest
• Review clarifications (1)

Section problems

• 50453 - The Cubic Difference
• 50451 - Processing Cost
• 50459 - The Biggest Digit
• 50538 - Sum of kth Diagonal
• 50465 - How many students have p...
• 50378 - Sum of the given digits
• 50470 - Close Pairs - Revised
• 50784 - Top Growing Company
• 50458 - Weekly Report
• 50478 - Letter Grades
• 50791 - Mine field
• 50867 - Average of the Best Grades
• 50782 - Max of N integers
• 50460 - Median of 3 Numbers
• 50552 - Casual shoes
• 50558 - Biggest Barn
• 50562 - List of students

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

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