HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50336 - Buying Carpets

Guest
• Review clarifications (2)

Section problems

• 50394 - Water Bills
• 50363 - Class GPA Average
• 50398 - Sum of kth Anti-diagonal
• 50651 - Largest power of two
• 50388 - Number of Armstrong Num...
• 50359 - Mode of a Series
• 50440 - Call Center
• 50353 - Cube of the Largest number
• 50336 - Buying Carpets
• 50295 - Weighted Average
• 50296 - Total Discount Rate
• 50289 - Monthly Allowance
• 50559 - Prime Factors of a Number
• 50568 - Body Mass Index Calculator
• 50579 - Pentagonal Numbers
• 50584 - Total invoice amount
• 50634 - Perfect numbers

Feedback

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

Time limit 4000/7000/7000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared By Ibrahim Mesecan.

Buying Carpets

Uncle of Mr. Gentjan Bajrami has passed away leaving a great castle to his only cousin Mr. Bajrami. The castle is very large and has a lot of rooms. Mr. Bajrami wants to change the carpets in the rooms. He has measured and taken notes for the rooms and now he wants to see how many metre square of carpet he needs.

Write a program that is going to read the size of rooms and calculate the size of the carpet needed to buy.

Input specification
The first line has an integer number (n) which shows the number of rooms where 1 ≤ n ≤ 1000. The following n lines contain integer number pairs (width and depth), where 1 ≤ width, depth ≤ 20.

Output specification
Show one number that represent the size (in m2) of the carpet needed to buy.

Sample Input:
  3
  5 2
  4 3
  4 2

Sample Output:
  30

Output Explanation:
   Total size of the carpet = ((5 * 2) + (4 * 3) + (4 * 2)) = 30


Для отправки решений необходимо выполнить вход.

www.contester.ru