oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • C++ Reference
  • About
    • Help
    • Terms of Use
    • Technical Specifications
    • Credits

area Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

area.html

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. You realize that this is a trivial calculation, but you understand that you need to solve this problem in order to test your ability to properly handle large amounts of data and large numbers under the IOI 2009 contest system.

Task

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

Constraints

1 ≤ N ≤ 500,000The number of land properties
1 ≤ Ak, Bk ≤ 20,000The lengths of the sides of property k

Input

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.

Output

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.

Sample Input 1

3
15 25
5 6
3 1

Sample Output 1

408

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100102s32MBAverage
2012s32MBAverage

Judge Compile Command

g++-7 ans.cpp -o area -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 31.05.2018 (F43DD)
Copyright © 2018 mrJudge. All rights reserved.

Under Construction

Stats Tab Content

Under Construction too