HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > APGC-1 > problem:


2. 50458 - Weekly Report

APGC-1

Start: Feb.04.2017 at 06:00:00 PM
Finish: Feb.05.2017 at 02:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 1. 51069 - Last Digit of a Fibonacci ...
• 2. 50458 - Weekly Report
• 3. 50742 - King Arthur II
• 4. 50930 - Tom and Jerry
• 5. 51073 - Campus Tours for High S...
• 6. 50694 - The Cheapest Flight

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