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.
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} $$$
The output should consist of a single integer $$$-$$$ the area that occurs an odd number of times.
4 -3 5 5 -3 13 -11 10 -8
3
2 10 8 14 4
12
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.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.