HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


004. 50424 - Area

Guest
• Review clarifications (1)

Volume problems

• 50812 - Total Discount for the clients
• 50832 - Rock Paper Scissors Lizard ...
• 51046 - The biggest number
• 50867 - Average of the Best Grades
• Reflektimi i pikes
• 50994 - The Most Crowded Station
• 51194 - The difference between max...
• 002. 50554 - nth power of m
• 004. 50424 - Area
• 004. 50522 - Multiplication Table - 2
• 012. 50352 - Selling Cows
• 017. 50537 - esreveR Triangle
• 018. 50491 - Brokers
• 018. 50787 - Expected Value
• 020. 50485 - Center of gravity of a ...
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...

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.
bfs.

Area

A large agricultural corporation is undertaking an audit of its N land properties. As a first step, they would like to know the total area of their properties.

Each property has a rectangular shape, and no two properties overlap.

Question: Write a program that, given the dimensions of N land properties, determines the sum of their areas.

Input specification:
Your program should read from the standard input the following data:

  • The first line contains a single integer: the number of properties N.
  • The next N lines describe the properties, one property per line. The kth of these lines describes property number k and it contains two integers separated by a single space: the lengths of the sides of the property Ak and Bk measured in meters

Constraints:
  1 ≤ N ≤ 50000 { The number of land properties
  1 ≤ (Ak , Bk) ≤10000 { The lengths of the sides of property k

Output specification:
Your program should write to the standard output a single line containing a single integer: the total area of all properties, measured in square meters.

Note:
The final answer may not fit in 32 bits. You have to use a 64-bit data type, such as long long in C/C++, in order to compute and store the answer in a single variable.

 Sample Input I     Sample Input II   
 3
 15 25
 5 6
 3 1
 4
 400 400
 200 200
 100 100
 50 50
 Sample Output I     Sample Output II   
 408
 212500


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

www.contester.ru