Prime Cut

View as PDF

Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

To win a game of Super Mario Party Jamboree™, Mario and Luigi must separate a steak into 2 pieces of equal area using one straight cut. But alas, the dastardly Bowser has interfered with the game! The wicked turtle has mangled the steak so that it is triangular. In addition, this mangled steak can only be cut in vertical lines perpendicular to the y-axis. Can you find where the plumber brothers must make their cut to bisect the steak?

Specifically, you are given the coordinates of the steak in cartesian form. You must find the value of x_i such that the line x = x_i bisects the triangle into 2 pieces of equal area.

Input

3 lines of input are given, each representing one point of the triangle.

Each contains 2 integers, x_i and y_i, representing the coordinates of one point of the triangle.

Output

Output one number, x_i, representing the x-value such that the line x = x_i bisect the triangle.

Answers within 10^{-3} of the correct answer will be accepted.

Constraints

  • -10^8 \le x_i, y_i \le 10^8
  • Points are distinct.
  • The points are guaranteed to be non-collinear (triangle has positive area).

Examples

Input
0 0
1 1
0 1
Output
0.2928924560546875

Cutting the triangle at x = 0.293 will divide the triangle in sides of area 0.25.

Input
-3 4
2 1
7 2
Output
2.0

Cutting the triangle at x = 2 will divide the triangle into equal halves.


Comments

There are no comments at the moment.