AlgoUniversity
  • Go Back
Discussion
Odd Circle Area :

Author

Yash Sahijwani

Difficulty Level : Easy

Submissions : 191

Asked In : IBM

Marks :30

: 2 | : 1

You are given a list of coordinates $$$(X, Y)$$$, where consecutive points in the list represent the coordinates of two diagonally opposite points of a square. For example, $$$(X_i, Y_i)$$$ and $$$(X_{i+1}, Y_{i+1})$$$ represent the diagonally opposite points of a square.

First we consider a single square and draw a circle whose center is one of the corner points of the square and it intersects the square's sides at the middle.

The task is to calculate the area of all such circles formed by the squares in the list and print the only area which occurs an odd number of times.

Input

The first line of input consists of a single integer $$$n$$$ $$$(1 \leq n \leq 10^6)$$$ $$$-$$$ the total number of coordinates in the list. The next $$$n$$$ lines each consist of 2 space separated integers $$$(X_i, Y_i)$$$. $$$- 10^{18} \leq X_i, Y_i \leq 10^{18} $$$

Output

The output should consist of a single integer $$$-$$$ the area that occurs an odd number of times.

Examples

Input
4
-3 5
5 -3
13 -11
10 -8
Output
3
Input
2
10 8
14 4
Output
12

Note

There will always be a single value which occurs an odd number of times. After each computation, you need to take a floor. So $$$area = floor(floor(pi) * floor(r) * floor(r))$$$

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.