2021 South Central USA Regional Contest — Division 1

Start

2022-03-05 13:00 CST

2021 South Central USA Regional Contest — Division 1

End

2022-03-05 18:00 CST
Contest is over.

Problem D
Dorm Room Divide

Bob and Alice are roommates at the International College of Polygonal Chambers (ICPC). To avoid conflict, they’ve agreed to divide their dorm room in half—as closely as possible. However, the room is shaped so irregularly that they need your help!

\includegraphics[width=0.75\textwidth ]{dorm.pdf}

Each dorm room is a convex polygon, with a single entrance. You need to figure out how to divide this room in half (by area) using a single straight line starting at the door, and terminating on a wall or corner of the room.

Input

The first line of input contains a single integer n (3 ≤ q n ≤ q 2 * 105), which is the number of vertices describing the convex polygon.

Each of the next n lines contains two space-separated integers x and y (-107 ≤ x,y ≤ 107). These are the coordinates of the vertices of the convex polygon, in counterclockwise order. All points will be distinct.

The door is considered to be a single point located at the first vertex given in the input.

Output

Output two space-separated real numbers, which are the x and y coordinates of the other endpoint of the dividing line, such that the area of the room is divided in half. Each coordinate value must be accurate to within an absolute or relative error of 10-6. Output x first, then y.

Note that Sample 1 corresponds to the example in the problem description.

Sample Input 1 Sample Output 1
5
7 1
8 3
5 5
2 3
3 1
3.5 4
Sample Input 2 Sample Output 2
3
2 2
10 3
6 8
8 5.5