EtashGuha's picture
Add files using upload-large-folder tool
6bc5462 verified
|
raw
history blame
1.2 kB

p00045 Sum and Average

Problem Description

Create a program that reads the sales unit price and sales quantity and outputs the total sales amount and the average sales quantity.

Input

The input is given in the following format:

Sales unit price, sales quantity Sales unit price, sales quantity :: ::

A comma-separated pair of unit price and quantity is given across multiple lines. All values ​​entered are greater than or equal to 0 and less than or equal to 1,000, and the number of unit price and quantity pairs does not exceed 100.

Output

Please output the total sales amount (integer) on the first line and the average sales quantity (integer) on the second line. If the average sales volume has a fraction (number after the decimal point), round off to the first decimal place.

Example

Input

100,20 50,10 70,35

Output

4950 22

Contest Information

  • Contest ID: 0
  • Problem Index:
  • Points: 0.0
  • Rating: 0
  • Tags:
  • Time Limit: {'seconds': 1, 'nanos': 0} seconds
  • Memory Limit: 134217728 bytes

Task

Solve this competitive programming problem. Provide a complete solution that handles all the given constraints and edge cases.